diff -Nru gyoto-0.0.3/.deps/Astrobj.Po gyoto-0.1.0/.deps/Astrobj.Po --- gyoto-0.0.3/.deps/Astrobj.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Astrobj.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Error.Po gyoto-0.1.0/.deps/Error.Po --- gyoto-0.0.3/.deps/Error.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Error.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Factory.Po gyoto-0.1.0/.deps/Factory.Po --- gyoto-0.0.3/.deps/Factory.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Factory.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Metric.Po gyoto-0.1.0/.deps/Metric.Po --- gyoto-0.0.3/.deps/Metric.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Metric.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Photon.Po gyoto-0.1.0/.deps/Photon.Po --- gyoto-0.0.3/.deps/Photon.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Photon.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Register.Po gyoto-0.1.0/.deps/Register.Po --- gyoto-0.0.3/.deps/Register.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Register.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Scenery.Po gyoto-0.1.0/.deps/Scenery.Po --- gyoto-0.0.3/.deps/Scenery.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Scenery.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Screen.Po gyoto-0.1.0/.deps/Screen.Po --- gyoto-0.0.3/.deps/Screen.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Screen.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/SmartPointer.Po gyoto-0.1.0/.deps/SmartPointer.Po --- gyoto-0.0.3/.deps/SmartPointer.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/SmartPointer.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Spectrometer.Po gyoto-0.1.0/.deps/Spectrometer.Po --- gyoto-0.0.3/.deps/Spectrometer.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Spectrometer.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Spectrum.Po gyoto-0.1.0/.deps/Spectrum.Po --- gyoto-0.0.3/.deps/Spectrum.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Spectrum.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/ThinDisk.Po gyoto-0.1.0/.deps/ThinDisk.Po --- gyoto-0.0.3/.deps/ThinDisk.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/ThinDisk.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Utils.Po gyoto-0.1.0/.deps/Utils.Po --- gyoto-0.0.3/.deps/Utils.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Utils.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/Worldline.Po gyoto-0.1.0/.deps/Worldline.Po --- gyoto-0.0.3/.deps/Worldline.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/Worldline.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/WorldlineIntegState.Po gyoto-0.1.0/.deps/WorldlineIntegState.Po --- gyoto-0.0.3/.deps/WorldlineIntegState.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/WorldlineIntegState.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/gyoto.Po gyoto-0.1.0/.deps/gyoto.Po --- gyoto-0.0.3/.deps/gyoto.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/gyoto.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.deps/libgyoto.Po gyoto-0.1.0/.deps/libgyoto.Po --- gyoto-0.0.3/.deps/libgyoto.Po 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.deps/libgyoto.Po 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +# dummy diff -Nru gyoto-0.0.3/.gitignore gyoto-0.1.0/.gitignore --- gyoto-0.0.3/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/.gitignore 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,23 @@ +*.fits +bin/gyoto +*.lo +*.o +ywrap.c +Makefile +autom4te.cache +.libs +config.log +config.status +doc/html/ +doc/latex +*.la +.deps +*.pc +*.so +*~ +libtool +config.h +include/GyotoConfig.h +include/stamp-h2 +stamp-h1 +yorick/stdplug/polishfit.i diff -Nru gyoto-0.0.3/ChangeLog gyoto-0.1.0/ChangeLog --- gyoto-0.0.3/ChangeLog 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/ChangeLog 2013-07-27 09:14:20.000000000 +0000 @@ -1,3 +1,19 @@ +0.1.0 2013/07/27 ABI 1 + * add units system + * add PolishDoughnut astrobj + * use pkg-config + * gyotoy ported to yorick-gy instead of python + * in Worldline, Photon and Scenery: rename tlim to tmin, default + value is -DBL_MAX. + * add a mutli-wavelength flavour of Astrobj::emission() + * install yorick plug-in under ${prefix}, not necessarily in Y_HOME + * add plugin attribute to the Metric, Astrobj and Spectrum entities + * reform build system to use the autotools + * add --plugins command-line option + * add virtual destrcuctor to Spectrum::Generic + * fix buffer overflow in lib/Factory.C + * update paper ref in bin/gyoto.C + 0.0.3 2012/05/01 BUG * fix a tiny bug in PatternDisk (initialization of phimin/max) * rearrange flags in Makefiles/local_settings @@ -6,6 +22,6 @@ 0.0.2 2012/04/19 PKG * install include files in include/Gyoto * add this ChangeLog - + 0.0.1 2012/04/16 ABI 0 * release diff -Nru gyoto-0.0.3/INSTALL gyoto-0.1.0/INSTALL --- gyoto-0.0.3/INSTALL 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/INSTALL 2013-07-27 09:14:20.000000000 +0000 @@ -1,20 +1,69 @@ INSTALLING GYOTO ================ +0- DISTRIBUTION PACKAGES +======================== + +Gyoto comes prepackaged for some systems. Of course, the development version +may be much more advanced at a given time. + +On Debian GNU/Linux (and derivatives), try: + sudo apt-get install gyoto gyoto-doc yorick-gyoto +Developers may be interested in gyoto-dbg and libgyoto0-dev in addition. + +On an Apple Mac, you can install MacPorts (http://www.macports.org/) and run: + sudo port install Gyoto + +If Gyoto is not packaged for your system or if you prefer to build +from source, read on. + +In un nutshell: +./configure +make +make check +sudo make install + + I- INSTALL THE DEPENDENCIES =========================== - xercesc-3 (recommended, required for the executable): http://xerces.apache.org/xerces-c/ - - cfitsio (required for the executable) + - cfitsio (required for the executable and some of the Astrobj): http://heasarc.gsfc.nasa.gov/fitsio/ + - libudunits2 (recommended, support for unit conversions): + http://www.unidata.ucar.edu/software/udunits/ + - Yorick (optional, provides an interface to the Yorick + interpreted language, allowing to write Gyoto scripts): + http://yorick.sourceforge.net/ + Yorick users will also need the yorick-yutils add-on + (https://github.com/frigaut/yorick-yutils) and may need to install + the yorick-dev package (in particulat Debian/Ubuntu users). - LORENE (optional, the libgyoto-lorene plug-in can be built later) http://www.lorene.obspm.fr/ On some systems, LORENE must be built with -fPIC (GYOTO as well, but this is the default). + - developers may need the GNU autotools: autoconf, automake, libtool. II- CONFIGURE GYOTO =================== -Edit local_settings to suite your needs +If all the dependencies are installed in standard places (/usr or +/usr/local) and if the default prefix (/usr/local) is OK for you, this +should do: + $ ./configure + +You may need to pass some options or configuration variables. To list +the available options: + ./configure --help +The standard GNU INSTALL file is appended to this file and documents +the most standard and obscure features. + +Example: assume you want to install in ${HOME}/mysoft, that LORENE is +in ${HOME}/mysoft/Lorene (but HOME_LORENE is not set), and Xerces and +CFITIO are in /opt/local: + $ ./configure --prefix=${HOME}/mysoft \ + --with-lorene=${HOME}/mysoft/Lorene \ + CPPFLAGS=-I/opt/local/include \ + LDFLAGS=-L/opt/local/lib III- BUILD ========== @@ -22,7 +71,6 @@ IV- TEST ======== - Several example files are provided in doc/examples. All the files without "rotstar3_1" should work out of the box. The rotstar3_1 require the lorene plug-in and some work to create lorene data @@ -40,6 +88,9 @@ $ spydr example-*.fits +In addition, if Gyoto has been configured to build the Yorick plug-in, +this plug-in is also tested. + V- INSTALL ========== If installing to a system location (i.e. if you don't @@ -60,23 +111,412 @@ or $ sudo ldconfig -v +VII- Setting your environment +============================= If installing in a non-standard place (e.g. under your home -directory), you should not run ldconfig but make sure that $PREFIX/lib -is listed in the LD_LIBRARY_PATH environment variable (Under Mac OS X, -it is called DYLD_LIBRARY_PATH). It goes beyond the scope of this -manual to teach you how to set environment variables; if in doubt ask -the local guru or google... - -VI- BUILD AND INSTALL THE YORICK PLUG-IN -======================================== -If you also want the Yorick plug-in: -1- install yorick (http://yorick.sourceforge.net/); -2- Run: - $ make yorick - $ make check-yorick - $ sudo make install-yorick +directory), you do not need to run ldconfig, but you need to adapt +your environment for instance by adding the following lines to +${HOME}/.profile (replace by the actual Gyoto +prefix!). One Gyoto file installed in each directory is listed as a +comment: + +export PREFIX= +export PATH=${PREFIX}/bin:${PATH} # gyoto +export LD_LIBRARY_PATH=${PREFIX}/lib:${LD_LIBRARY_PATH} # libgyoto.so.* +export MANPATH=${PREFIX}/share/man:${MANPATH} # gyoto.1 +export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig # gyoto.pc + +Under Mac OS X, LD_LIBRARY_PATH is replaced by DYLD_LIBRARY_PATH. + +It goes beyond the scope of this manual to teach you how to set +environment variables; if in doubt ask the local guru or google... + +By default, the Yorick plug-in is also installed under ${prefix}. If +Yorick itself is un ${prefix}, then the plug-in will be installed +directly with the rest of Yorick and hence will be found by Yorick. On +the other hand, if Yorick is not under ${prefix}, the plug-in may not +be found immediately by Yorick. Assuming you used the default prefix +(/usr/local), it should be sufficient to create a file named +${HOME}/Yorick/custom.i containing the three following lines: + +require, "pathfun.i"; +add_y_home,"/usr/local/lib/yorick/"; +command_line= process_argv(); + +Under Debian and Ubuntu GNU/Linux, /usr/local/lib/yorick/ is by +default in Yorick search paths. + + +VII- More on GNU ./configure script: +==================================== + +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ -VII- BUILD THE DOCUMENTATION -============================ + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. -To build the documentation, "make doc". +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff -Nru gyoto-0.0.3/INSTALL.ubuntu gyoto-0.1.0/INSTALL.ubuntu --- gyoto-0.0.3/INSTALL.ubuntu 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/INSTALL.ubuntu 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -INSTALLING GYOTO ON UBUNTU -========================== - -This regards Ubuntu 11.10 but should be valid for other versions. - -1/ Required packages - ------------------ -Install the following packages from Ubuntu Software Center: -g++ -git -libxerces-c3.1 -libxerces-c-dev -libcfitsio3-dev -yorick -yorick-dev -yorick-yutils -yorick-spydr - -2/ Select the proper local_settings file - ------------------------------------- - $ cd Gyoto - $ cp local_settings_ubuntu local_settings - -3/ Compilation - ----------- - $ make - -Then follow the instructions from step IV in the INSTALL file. diff -Nru gyoto-0.0.3/Makefile gyoto-0.1.0/Makefile --- gyoto-0.0.3/Makefile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -SHELL=/bin/sh -DIR=lib bin -CLEAN_DIR=$(addprefix clean-,$(DIR)) -INSTALL_DIR=$(addprefix install-,$(DIR)) -UNINSTALL_DIR=$(addprefix uninstall-,$(DIR)) - -include local_settings - -GYOTO_VERSION=$(subst gyoto-,,`basename $(CURDIR)`) - -all: $(DIR) yorick - -$(DIR) doc: - cd $@; $(MAKE) - -install: $(INSTALL_DIR) install-yorick -$(INSTALL_DIR): - cd $(subst install-,,$@) ; $(MAKE) install - -uninstall: $(UNINSTALL_DIR) uninstall-yorick -$(UNINSTALL_DIR): - cd $(subst uninstall-,,$@) ; $(MAKE) uninstall - -clean: $(CLEAN_DIR) clean-doc clean-yorick - rm -f example-*.fits -$(CLEAN_DIR) clean-doc: - cd $(subst clean-,,$@); $(MAKE) clean - -bin/gyoto: bin/*.C - make bin - -lib/$(LIBGYOTO_FILE): lib/*.C - make lib - -CHECK_CMD:=$(DYLIB_VAR)=lib:$$$(DYLIB_VAR) bin/gyoto -check: lib/$(LIBGYOTO_FILE) bin/gyoto check-yorick - $(CHECK_CMD) doc/examples/example-thin-disk.xml \ - \!example-thin-disk.fits - $(CHECK_CMD) doc/examples/example-complex-astrobj.xml \ - \!example-complex-astrobj.fits - $(CHECK_CMD) doc/examples/example-fixed-star.xml \ - \!example-fixed-star.fits - $(CHECK_CMD) --resolution=32 doc/examples/example-moving-star.xml \ - \!example-moving-star.fits - $(CHECK_CMD) doc/examples/example-page-thorne-disk-BL.xml \ - \!example-page-thorne-disk-BL.fits - $(CHECK_CMD) doc/examples/example-page-thorne-disk-KS.xml \ - \!example-page-thorne-disk-KS.fits - $(CHECK_CMD) doc/examples/example-torus.xml \ - \!example-torus.fits - -yorick yorick/gyoto.so yorick/gyoto_std.so: yorick/*.C yorick/stdplug/*.C - if which $(YORICK); then cd yorick; $(YORICK) -batch make.i; $(MAKE); fi - -check-yorick: yorick/gyoto.so yorick/gyoto_std.so - if which $(YORICK); then \ - cd yorick; \ - $(DYLIB_VAR)=../lib:$$$(DYLIB_VAR) \ - GYOTO_CHECK_NODISPLAY=true \ - $(YORICK) -i check.i; \ - fi - -install-yorick uninstall-yorick: yorick/gyoto.so yorick/gyoto_std.so - if which $(YORICK); then \ - cd yorick; \ - $(MAKE) $(subst -yorick,,$@); \ - fi - -clean-yorick distclean-yorick: - if which $(YORICK); then \ - cd yorick; \ - $(YORICK) -batch make.i; \ - $(MAKE) $(subst -yorick,,$@); \ - fi - -distclean: clean distclean-yorick - -tbz: distclean - cd ..; \ - tar cvf - \ - --exclude=.git --exclude=.gitignore --exclude=.pc --exclude=debian \ - `basename $(CURDIR)` | \ - bzip2 > gyoto_$(GYOTO_VERSION).tbz - -.PHONY: all $(DIR) clean $(CLEAN_DIR) install $(INSTALL_DIR) uninstall $(UNINSTALL_DIR) distclean check yorick check-yorick clean-yorick install-yorick uninstall-yorick doc clean-doc distclean-yorick tbz - diff -Nru gyoto-0.0.3/Makefile.am gyoto-0.1.0/Makefile.am --- gyoto-0.0.3/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/Makefile.am 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,5 @@ +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS=@mySUBDIRS@ +$(SUBDIRS): + cd $@ ; $(MAKE) +.PHONY: $(SUBDIRS) diff -Nru gyoto-0.0.3/Makefile.in gyoto-0.1.0/Makefile.in --- gyoto-0.0.3/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/Makefile.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,835 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure $(top_srcdir)/doc/Makefile.in \ + $(top_srcdir)/include/GyotoConfig.h.in \ + $(top_srcdir)/yorick/Makefile.in \ + $(top_srcdir)/yorick/gyoto.info.in \ + $(top_srcdir)/yorick/stdplug/Makefile.in AUTHORS COPYING \ + ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h $(top_builddir)/include/GyotoConfig.h +CONFIG_CLEAN_FILES = doc/Makefile yorick/Makefile \ + yorick/stdplug/Makefile yorick/gyoto.info +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFITSIOCPPFLAGS = @CFITSIOCPPFLAGS@ +CFITSIOLDFLAGS = @CFITSIOLDFLAGS@ +CFITSIO_CFLAGS = @CFITSIO_CFLAGS@ +CFITSIO_LIBS = @CFITSIO_LIBS@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DYLIB_VAR = @DYLIB_VAR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HOME_LORENE = @HOME_LORENE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LORENECPPFLAGS = @LORENECPPFLAGS@ +LORENELDFLAGS = @LORENELDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_S = @MAKE_S@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POW_LIB = @POW_LIB@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYS = @SYS@ +UDUNITS_CFLAGS = @UDUNITS_CFLAGS@ +UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@ +UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@ +UDUNITS_LIBS = @UDUNITS_LIBS@ +VERSINFO = @VERSINFO@ +VERSION = @VERSION@ +XERCESCPPFLAGS = @XERCESCPPFLAGS@ +XERCESLDFLAGS = @XERCESLDFLAGS@ +XERCES_CFLAGS = @XERCES_CFLAGS@ +XERCES_LIBS = @XERCES_LIBS@ +YORICK = @YORICK@ +Y_INST_HOME = @Y_INST_HOME@ +Y_INST_SITE = @Y_INST_SITE@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +mySUBDIRS = @mySUBDIRS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkg_cflags = @pkg_cflags@ +pkg_libs = @pkg_libs@ +pkg_requires = @pkg_requires@ +plugin_sfx = @plugin_sfx@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sovers = @sovers@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = @mySUBDIRS@ +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +include/GyotoConfig.h: include/stamp-h2 + @if test ! -f $@; then rm -f include/stamp-h2; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) include/stamp-h2; else :; fi + +include/stamp-h2: $(top_srcdir)/include/GyotoConfig.h.in $(top_builddir)/config.status + @rm -f include/stamp-h2 + cd $(top_builddir) && $(SHELL) ./config.status include/GyotoConfig.h + +distclean-hdr: + -rm -f config.h stamp-h1 include/GyotoConfig.h include/stamp-h2 +doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +yorick/Makefile: $(top_builddir)/config.status $(top_srcdir)/yorick/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +yorick/stdplug/Makefile: $(top_builddir)/config.status $(top_srcdir)/yorick/stdplug/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +yorick/gyoto.info: $(top_builddir)/config.status $(top_srcdir)/yorick/gyoto.info.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am + +$(SUBDIRS): + cd $@ ; $(MAKE) +.PHONY: $(SUBDIRS) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gyoto-0.0.3/Makefile.obs gyoto-0.1.0/Makefile.obs --- gyoto-0.0.3/Makefile.obs 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/Makefile.obs 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,779 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/gyoto +pkgincludedir = $(includedir)/gyoto +pkglibdir = $(libdir)/gyoto +pkglibexecdir = $(libexecdir)/gyoto +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure $(top_srcdir)/doc/Makefile.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = doc/Makefile +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = ${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11 +AMTAR = $${TAR-tar} +AR = ar +AUTOCONF = ${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf +AUTOHEADER = ${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader +AUTOMAKE = ${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11 +AWK = mawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFITSIOCPPFLAGS = +CFITSIOLDFLAGS = -lcfitsio +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +FGREP = /bin/grep -F +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = +LIBOBJS = +LIBS = -ldl +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = gyoto +PACKAGE_BUGREPORT = gyoto@sympa.obspm.fr +PACKAGE_NAME = gyoto +PACKAGE_STRING = gyoto 0.0.4 +PACKAGE_TARNAME = gyoto +PACKAGE_URL = +PACKAGE_VERSION = 0.0.4 +PATH_SEPARATOR = : +POW_LIB = +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +VERSION = 0.0.4 +XERCESCPPFLAGS = +XERCESLDFLAGS = -lxerces-c +YORICK = yorick +abs_builddir = /home/thibaut/git/Gyoto +abs_srcdir = /home/thibaut/git/Gyoto +abs_top_builddir = /home/thibaut/git/Gyoto +abs_top_srcdir = /home/thibaut/git/Gyoto +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/thibaut/git/Gyoto/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +plugin_sfx = so +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +sovers = 0.0.0 +srcdir = . +subdirs = yorick +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = +top_builddir = . +top_srcdir = . +use_cfitsio = -DGYOTO_USE_CFITSIO +use_xerces = -DGYOTO_USE_XERCES +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = lib bin +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gyoto-0.0.3/Makefile.old gyoto-0.1.0/Makefile.old --- gyoto-0.0.3/Makefile.old 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/Makefile.old 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,86 @@ +SHELL=/bin/sh +DIR=lib bin +CLEAN_DIR=$(addprefix clean-,$(DIR)) +INSTALL_DIR=$(addprefix install-,$(DIR)) +UNINSTALL_DIR=$(addprefix uninstall-,$(DIR)) + +include local_settings + +GYOTO_VERSION=$(subst gyoto-,,`basename $(CURDIR)`) + +all: $(DIR) yorick + +$(DIR) doc: + cd $@; $(MAKE) + +install: $(INSTALL_DIR) install-yorick +$(INSTALL_DIR): + cd $(subst install-,,$@) ; $(MAKE) install + +uninstall: $(UNINSTALL_DIR) uninstall-yorick +$(UNINSTALL_DIR): + cd $(subst uninstall-,,$@) ; $(MAKE) uninstall + +clean: $(CLEAN_DIR) clean-doc clean-yorick + rm -f example-*.fits +$(CLEAN_DIR) clean-doc: + cd $(subst clean-,,$@); $(MAKE) clean + +bin/gyoto: bin/*.C + make bin + +lib/$(LIBGYOTO_FILE): lib/*.C + make lib + +CHECK_CMD:=$(DYLIB_VAR)=lib:$$$(DYLIB_VAR) bin/gyoto +check: lib/$(LIBGYOTO_FILE) bin/gyoto check-yorick + $(CHECK_CMD) doc/examples/example-thin-disk.xml \ + \!example-thin-disk.fits + $(CHECK_CMD) doc/examples/example-complex-astrobj.xml \ + \!example-complex-astrobj.fits + $(CHECK_CMD) doc/examples/example-fixed-star.xml \ + \!example-fixed-star.fits + $(CHECK_CMD) --resolution=32 doc/examples/example-moving-star.xml \ + \!example-moving-star.fits + $(CHECK_CMD) doc/examples/example-page-thorne-disk-BL.xml \ + \!example-page-thorne-disk-BL.fits + $(CHECK_CMD) doc/examples/example-page-thorne-disk-KS.xml \ + \!example-page-thorne-disk-KS.fits + $(CHECK_CMD) doc/examples/example-torus.xml \ + \!example-torus.fits + +yorick yorick/gyoto.so yorick/gyoto_std.so: yorick/*.C yorick/stdplug/*.C + if which $(YORICK); then cd yorick; $(YORICK) -batch make.i; $(MAKE); fi + +check-yorick: yorick/gyoto.so yorick/gyoto_std.so + if which $(YORICK); then \ + cd yorick; \ + $(DYLIB_VAR)=../lib:$$$(DYLIB_VAR) \ + GYOTO_CHECK_NODISPLAY=true \ + $(YORICK) -i check.i; \ + fi + +install-yorick uninstall-yorick: yorick/gyoto.so yorick/gyoto_std.so + if which $(YORICK); then \ + cd yorick; \ + $(MAKE) $(subst -yorick,,$@); \ + fi + +clean-yorick distclean-yorick: + if which $(YORICK); then \ + cd yorick; \ + $(YORICK) -batch make.i; \ + $(MAKE) $(subst -yorick,,$@); \ + fi + +distclean: clean distclean-yorick + +tbz: distclean + cd ..; \ + tar cvf - \ + --exclude=.git --exclude=.gitignore --exclude=.pc --exclude=debian \ + `basename $(CURDIR)` | \ + bzip2 > gyoto_$(GYOTO_VERSION).tbz + +.PHONY: all $(DIR) clean $(CLEAN_DIR) install $(INSTALL_DIR) uninstall $(UNINSTALL_DIR) distclean check yorick check-yorick clean-yorick install-yorick uninstall-yorick doc clean-doc distclean-yorick tbz + diff -Nru gyoto-0.0.3/README.lorene gyoto-0.1.0/README.lorene --- gyoto-0.0.3/README.lorene 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/README.lorene 2013-07-27 09:14:20.000000000 +0000 @@ -17,30 +17,7 @@ If HOME_LORENE is defined when compiling Gyoto, the lorene plug-in is automatically built and installed. -II- BUILDING AFTER GYOTO -======================== - -You don't need to recompile Gyoto to enable lorene if you first built -it without lorene. Just install LORENE and set HOME_LORENE correctly, then: - -1- Under Linux: - $ cd lib - $ make -f Makefile.lorene -This will result in the file lib/libgyoto-lorene.so, copy this file -next to libgyoto.so. - -2- Under Mac OS X: - -First find where libgyoto.dylib is located, for instance by running: - $ locate libgyoto.dylib -The default location when installing from source is /usr/local/lib/. - -Then run: - $ cd lib - $ make -f Makefile.lorene LIBGYOTO_PATH=/usr/local/lib/ - $ cp libgyoto-lorene.dylib /usr/local/lib/ - -III- TESTING LIBGYOTO-LORENE +II- TESTING LIBGYOTO-LORENE ============================ Two example files are provided in doc/examples/: diff -Nru gyoto-0.0.3/VERSION gyoto-0.1.0/VERSION --- gyoto-0.0.3/VERSION 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/VERSION 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1 @@ +0.0.3x diff -Nru gyoto-0.0.3/aclocal.m4 gyoto-0.1.0/aclocal.m4 --- gyoto-0.0.3/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/aclocal.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,981 @@ +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ax_append_compile_flags.m4]) +m4_include([m4/ax_append_flag.m4]) +m4_include([m4/ax_check_compile_flag.m4]) +m4_include([m4/ax_pthread.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/pkg.m4]) diff -Nru gyoto-0.0.3/bin/Makefile gyoto-0.1.0/bin/Makefile --- gyoto-0.0.3/bin/Makefile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/bin/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -SHELL=/bin/sh - -include ../local_settings - -.SUFFIXES : .o .C - -#SRC = code.C RayTracingSch.C RayTracingSch_Disk.C #truc.C -#SRC = Orbite.C RayTracing.C -#OBJ = $(SRC:.C=.o) - -LIB_SRC = $(shell ls ../lib/*.C) -HDRS = $(shell ls ../include/*.h) - -EXE_ALL = gyoto -# the gyoto executable requires XERCES -ifeq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) -EXE = $(filter-out gyoto,$(EXE_ALL)) -else -EXE = $(EXE_ALL) -endif - -all: $(EXE) - -.C.o: - $(CXX) -c $(GYOTO_FLAGS) -I../include $(CPPFLAGS) $(CXXFLAGS) $< - -ray: RayTracing.o ../lib/libgyoto.a - $(CXX) -o $@ $(CXXFLAGS) $(GYOTO_INC) $^ $(LIB_CXX_Gyoto) - -gyoto: gyoto.o ../lib/$(LIBGYOTO_FILE) - $(CXX) -o $@ $(LDFLAGS) $(LDLIBS) $< -L../lib -lgyoto -ldl - -dbgyoto: debugyoto.C ../lib/libgyoto.a - $(CXX) -o $@ $(CXXFLAGS) $(GYOTO_INC) $^ $(LIB_CXX_Gyoto) $(LIB_CXX) $(LIB_CFITSIO) $(LIB_LORENE) $(LIB_LAPACK) $(LIB_GSL) $(LIB_PGPLOT) -Wno-long-long - -orbite: Orbite.o ../lib/libgyoto.a - $(CXX) -o $@ $(CXXFLAGS) $(GYOTO_INC) $^ $(LIB_CXX_Gyoto) - -gyotorbit: gyotorbit.C ../lib/libgyoto.a - $(CXX) -o $@ $(CXXFLAGS) $(GYOTO_INC) $^ $(LIB_CXX_Gyoto) $(LIB_CXX) $(LIB_CFITSIO) $(LIB_LORENE) $(LIB_LAPACK) $(LIB_GSL) $(LIB_PGPLOT) -Wno-long-long - -../lib/libgyoto.a: $(HDRS) $(LIB_SRC) - make -C ../lib libgyoto.a - -doc: doc.C $(SRC) *.h - doxygen doxyfile - -clean: - rm -f $(OBJ) - rm -f $(EXE_ALL) - rm -fr Doc - rm -fr *~ - rm -f libgyoto.a - rm -fr gyoto.dSYM - -$(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/bin: - install -d $@ - -ifeq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) -install: -else -install: $(EXE) $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 gyoto.1 - install -m 0755 $(EXE) $(DESTDIR)$(PREFIX)/bin - install -m 0644 gyoto.1 $(DESTDIR)$(PREFIX)/share/man/man1 -endif - -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/gyoto - rm -f $(DESTDIR)$(PREFIX)/share/man/man1/gyoto.1 - -.PHONY: clean install uninstall \ No newline at end of file diff -Nru gyoto-0.0.3/bin/Makefile.am gyoto-0.1.0/bin/Makefile.am --- gyoto-0.0.3/bin/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/bin/Makefile.am 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,33 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_CPPFLAGS = -I@top_builddir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) +AM_LDFLAGS = $(XERCESLDFLAGS) $(PTHREAD_LIBS) +AM_CXXFLAGS = -rdynamic $(PTHREAD_CFLAGS) +CLEANFILES=example-*.fits + +bin_PROGRAMS = gyoto +dist_man_MANS = gyoto.1 +gyoto_SOURCES = gyoto.C +gyoto_LDADD = @top_builddir@/lib/libgyoto.la +gyoto_CPPFLAGS = $(AM_CPPFLAGS) $(CFITSIOCPPFLAGS) +gyoto_LDFLAGS = $(AM_LDFLAGS) $(CFITSIOLDFLAGS) -export-dynamic + +CHECK_CMD = unset GYOTO_PLUGINS && ./gyoto +check: gyoto + $(CHECK_CMD) ../doc/examples/example-thin-disk.xml \ + \!example-thin-disk.fits + $(CHECK_CMD) ../doc/examples/example-complex-astrobj.xml \ + \!example-complex-astrobj.fits + $(CHECK_CMD) ../doc/examples/example-fixed-star.xml \ + \!example-fixed-star.fits + $(CHECK_CMD) --resolution=32 ../doc/examples/example-moving-star.xml \ + \!example-moving-star.fits + $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL.xml \ + \!example-page-thorne-disk-BL.fits + $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-KS.xml \ + \!example-page-thorne-disk-KS.fits + $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL-with-basis.xml \ + \!example-page-thorne-disk-BL-with-basis.fits + $(CHECK_CMD) ../doc/examples/example-torus.xml \ + \!example-torus.fits + $(CHECK_CMD) ../doc/examples/example-polish-doughnut.xml \ + \!example-polish-doughnut.fits diff -Nru gyoto-0.0.3/bin/Makefile.am~ gyoto-0.1.0/bin/Makefile.am~ --- gyoto-0.0.3/bin/Makefile.am~ 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/bin/Makefile.am~ 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,11 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_CPPFLAGS = -I@top_srcdir@/include $(XERCESCPPFLAGS) +AM_LDFLAGS = $(XERCESLDFLAGS) +AM_CXXFLAGS = @use_xerces@ @use_cfitsio@ -rdynamic \ + -DGYOTO_PLUGIN_SFX=\"@plugin_sfx@\" -DGYOTO_PREFIX=\"@prefix@\" \ + -DGYOTO_SOVERS=\"@sovers@\" -fPIC +lib_LTLIBRARIES = libgyoto.la +libgyoto_la_SOURCES = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ + Worldline.C FocalPlane.C Photon.C Scenery.C \ + WorldlineIntegState.C Error.C Screen.C Spectrum.C \ + Spectrometer.C ThinDisk.C diff -Nru gyoto-0.0.3/bin/Makefile.in gyoto-0.1.0/bin/Makefile.in --- gyoto-0.0.3/bin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/bin/Makefile.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,725 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = gyoto$(EXEEXT) +subdir = bin +DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/include/GyotoConfig.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) +am_gyoto_OBJECTS = gyoto-gyoto.$(OBJEXT) +gyoto_OBJECTS = $(am_gyoto_OBJECTS) +gyoto_DEPENDENCIES = @top_builddir@/lib/libgyoto.la +gyoto_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(gyoto_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(gyoto_SOURCES) +DIST_SOURCES = $(gyoto_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFITSIOCPPFLAGS = @CFITSIOCPPFLAGS@ +CFITSIOLDFLAGS = @CFITSIOLDFLAGS@ +CFITSIO_CFLAGS = @CFITSIO_CFLAGS@ +CFITSIO_LIBS = @CFITSIO_LIBS@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DYLIB_VAR = @DYLIB_VAR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HOME_LORENE = @HOME_LORENE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LORENECPPFLAGS = @LORENECPPFLAGS@ +LORENELDFLAGS = @LORENELDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_S = @MAKE_S@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POW_LIB = @POW_LIB@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYS = @SYS@ +UDUNITS_CFLAGS = @UDUNITS_CFLAGS@ +UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@ +UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@ +UDUNITS_LIBS = @UDUNITS_LIBS@ +VERSINFO = @VERSINFO@ +VERSION = @VERSION@ +XERCESCPPFLAGS = @XERCESCPPFLAGS@ +XERCESLDFLAGS = @XERCESLDFLAGS@ +XERCES_CFLAGS = @XERCES_CFLAGS@ +XERCES_LIBS = @XERCES_LIBS@ +YORICK = @YORICK@ +Y_INST_HOME = @Y_INST_HOME@ +Y_INST_SITE = @Y_INST_SITE@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +mySUBDIRS = @mySUBDIRS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkg_cflags = @pkg_cflags@ +pkg_libs = @pkg_libs@ +pkg_requires = @pkg_requires@ +plugin_sfx = @plugin_sfx@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sovers = @sovers@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 +AM_CPPFLAGS = -I@top_builddir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) +AM_LDFLAGS = $(XERCESLDFLAGS) $(PTHREAD_LIBS) +AM_CXXFLAGS = -rdynamic $(PTHREAD_CFLAGS) +CLEANFILES = example-*.fits +dist_man_MANS = gyoto.1 +gyoto_SOURCES = gyoto.C +gyoto_LDADD = @top_builddir@/lib/libgyoto.la +gyoto_CPPFLAGS = $(AM_CPPFLAGS) $(CFITSIOCPPFLAGS) +gyoto_LDFLAGS = $(AM_LDFLAGS) $(CFITSIOLDFLAGS) -export-dynamic +CHECK_CMD = unset GYOTO_PLUGINS && ./gyoto +all: all-am + +.SUFFIXES: +.SUFFIXES: .C .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bin/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +gyoto$(EXEEXT): $(gyoto_OBJECTS) $(gyoto_DEPENDENCIES) $(EXTRA_gyoto_DEPENDENCIES) + @rm -f gyoto$(EXEEXT) + $(gyoto_LINK) $(gyoto_OBJECTS) $(gyoto_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gyoto-gyoto.Po@am__quote@ + +.C.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.C.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.C.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +gyoto-gyoto.o: gyoto.C +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gyoto-gyoto.o -MD -MP -MF $(DEPDIR)/gyoto-gyoto.Tpo -c -o gyoto-gyoto.o `test -f 'gyoto.C' || echo '$(srcdir)/'`gyoto.C +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/gyoto-gyoto.Tpo $(DEPDIR)/gyoto-gyoto.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='gyoto.C' object='gyoto-gyoto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gyoto-gyoto.o `test -f 'gyoto.C' || echo '$(srcdir)/'`gyoto.C + +gyoto-gyoto.obj: gyoto.C +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gyoto-gyoto.obj -MD -MP -MF $(DEPDIR)/gyoto-gyoto.Tpo -c -o gyoto-gyoto.obj `if test -f 'gyoto.C'; then $(CYGPATH_W) 'gyoto.C'; else $(CYGPATH_W) '$(srcdir)/gyoto.C'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/gyoto-gyoto.Tpo $(DEPDIR)/gyoto-gyoto.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='gyoto.C' object='gyoto-gyoto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gyoto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gyoto-gyoto.obj `if test -f 'gyoto.C'; then $(CYGPATH_W) 'gyoto.C'; else $(CYGPATH_W) '$(srcdir)/gyoto.C'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-man \ + uninstall-man1 + +check: gyoto + $(CHECK_CMD) ../doc/examples/example-thin-disk.xml \ + \!example-thin-disk.fits + $(CHECK_CMD) ../doc/examples/example-complex-astrobj.xml \ + \!example-complex-astrobj.fits + $(CHECK_CMD) ../doc/examples/example-fixed-star.xml \ + \!example-fixed-star.fits + $(CHECK_CMD) --resolution=32 ../doc/examples/example-moving-star.xml \ + \!example-moving-star.fits + $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL.xml \ + \!example-page-thorne-disk-BL.fits + $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-KS.xml \ + \!example-page-thorne-disk-KS.fits + $(CHECK_CMD) ../doc/examples/example-page-thorne-disk-BL-with-basis.xml \ + \!example-page-thorne-disk-BL-with-basis.fits + $(CHECK_CMD) ../doc/examples/example-torus.xml \ + \!example-torus.fits + $(CHECK_CMD) ../doc/examples/example-polish-doughnut.xml \ + \!example-polish-doughnut.fits + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gyoto-0.0.3/bin/Makefile.old gyoto-0.1.0/bin/Makefile.old --- gyoto-0.0.3/bin/Makefile.old 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/bin/Makefile.old 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,52 @@ +SHELL=/bin/sh + +include ../local_settings + +.SUFFIXES : .o .C + +SRC = gyoto.C +OBJ = $(SRC:.C=.o) + +LIB_SRC = $(shell ls ../lib/*.C) +HDRS = $(shell ls ../include/*.h) + +EXE_ALL = gyoto +# the gyoto executable requires XERCES +ifeq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) +EXE = $(filter-out gyoto,$(EXE_ALL)) +else +EXE = $(EXE_ALL) +endif + +all: $(EXE) + +.C.o: + $(CXX) -c $(GYOTO_FLAGS) -I../include $(CPPFLAGS) $(CXXFLAGS) $< + +gyoto: gyoto.o ../lib/$(LIBGYOTO_FILE) + $(CXX) -o $@ $< -L../lib -lgyoto -ldl $(LDFLAGS) $(LDLIBS) + +clean: + rm -f $(OBJ) + rm -f $(EXE_ALL) + rm -fr Doc + rm -fr *~ + rm -f libgyoto.a + rm -fr gyoto.dSYM + +$(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/bin: + install -d $@ + +ifeq (,$(findstring -DGYOTO_USE_XERCES,$(GYOTO_FLAGS))) +install: +else +install: $(EXE) $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 gyoto.1 + install -m 0755 $(EXE) $(DESTDIR)$(PREFIX)/bin + install -m 0644 gyoto.1 $(DESTDIR)$(PREFIX)/share/man/man1 +endif + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/gyoto + rm -f $(DESTDIR)$(PREFIX)/share/man/man1/gyoto.1 + +.PHONY: clean install uninstall \ No newline at end of file diff -Nru gyoto-0.0.3/bin/gyoto.1 gyoto-0.1.0/bin/gyoto.1 --- gyoto-0.0.3/bin/gyoto.1 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/bin/gyoto.1 2013-07-27 09:14:20.000000000 +0000 @@ -1,15 +1,17 @@ .\" Process this file with .\" groff -man -Tascii foo.1 .\" -.TH GYOTO 1 "AUGUST 2011" Science "User Manuals" +.TH GYOTO 1 "AUGUST 2013" Science "User Manuals" .SH NAME Gyoto \- the General relativitY Orbit Tracer of Observatoire de Paris .SH SYNOPSIS gyoto [\fB\-\-silent\fR|\fB\-\-quiet\fR|\fB\-\-verbose\fR[=\fIN\fR]|\fB\-\-debug\fR] [\fB\-\-imin\fR=\fIi0\fR] [\fB\-\-imax\fR=\fIi1\fR] [\fB\-\-jmin\fR=\fIj0\fR] [\fB\-\-jmax\fR=\fIj1\fR] - [\fB\-\-time\fR=\fItobs\fR] + [\fB\-\-time\fR=\fItobs\fR] [\fB\-\-tmin\fR=\fItmin\fR] [\fB\-\-fov\fR=\fIangle\fR] [\fB\-\-resolution\fR=\fInpix\fR] [\fB\-\-distance\fR=\fIdist\fR] [\fB\-\-paln\fR=\fIOmega\fR] [\fB\-\-inclination\fR=\fIi\fR] [\fB\-\-argument\fR=\fItheta\fR] + [\fB\-\-nthreads\fR=\fInth\fR] [\fB\-\-plugins\fR=\fIpluglist\fR] + [\fB\-\-impact-coords\fR[=\fIfname.fits\fR]] [\fB\-\-\fR] \fIinput.xml \fIoutput.fits .SH DESCRIPTION Gyoto is a framework for computing geodesics in curved @@ -23,8 +25,8 @@ ray-tracing, and saves the result in FITS format. A companion program, \fBgyotoy\fR(1), can be used to interactively -visualize a single geodesic in Kerr metric (the trajectory of a single -photon or massive particle. +visualize a single geodesic in any Gyoto metric (the trajectory of a +single photon or massive particle). Ray-tracing can be very time consuming. It is possible to interrupt the process at any time by hitting ^C, which will save the @@ -46,6 +48,11 @@ .IP \fB\-\-debug\fR Insanely verbose. +.SS Choosing plug-ins +.IP \fB\-\-plugins\fR=\fI[nofail:]plug1[,[nofail:]plug2][...] +Comma-separated list of Gyoto plugins to load. Overwrites GYOTO_PLUGINS +environment variable below. + .SS Selecting a region It's possible to ray-trace only part of the scenery by providing the pixel coordinates of the bottom-left (\fIi0\fR, \fIj0\fR) and @@ -63,7 +70,7 @@ .SS Setting the camera position The following parameters are normally provided in the Screen section of \fIinput.xml\fR but can be overridden on the command line for -instance to make a movie (by calling \fBgyoto\fB for each movie frame, +instance to make a movie (by calling \fBgyoto\fR for each movie frame, changing only the option \fB\-\-time\fR). .IP \fB\-\-time\fR=\fItobs The observing time in geometrical units. @@ -87,6 +94,14 @@ .SS Miscellaneous Unsorted option(s): +.IP \fB\-\-nthreads\fR=\fInth\fR +Number of parallel threads to use. For instance, on a dual-core +machine, \fB\-\-nthreads\fR=2 should yield the fastest +computation. This option is silently ignored if Gyoto was compiled +without POSIX threads support. Note that the metric and object are +replicated for each thread which can lead to a decrease in performance +if either is memory-intensive. Setting this option to 0 is equivalent +to setting it to 1. .IP \fB\-\-impact\-coords\fR[=\fIimpactcoords.fits\fR] In some circumstances, you may want to perform several computations in which the computed geodesics end up being exactly identical. This is @@ -131,7 +146,7 @@ \fB\-\-impact\-coords\fR=\fIimpactcoords.fits\fR \fB\-\-impact\-coords\fR .IP In this case, the impact coordinates are read from -\fIimpactcoords.fits\fR, shifted in time, and save in +\fIimpactcoords.fits\fR, shifted in time, and saved in \fIoutput.fits\fR. .RE @@ -140,7 +155,11 @@ A gyoto input file in XML format. Several examples are provided in the source doc/examples directory. Depending on how you installed \fBgyoto\fR, they may be installed on your system in a place such as -\fI/usr/share/doc/libgyoto/examples/\fR. +\fI/usr/share/doc/libgyoto/examples/\fR. It goes beyond the scope of +this manpage to document the XML file format supported by Gyoto, +please refer to the library documentation which may be distributed by +your package manager, can be compiled from the Gyoto source, and can +be consulted online at \fIhttp://gyoto.obspm.fr/\fR. .IP \fIoutput.fits The output image in FITS format. \fBgyoto\fR will not overwrite \fIoutput.fits\fR unless it is prefixed with an (escaped) "!": "gyoto @@ -151,14 +170,16 @@ .SH ENVIRONMENT .IP GYOTO_PLUGINS Gyoto astronomical objects and metrics are implemented in plug-ins. To -use more (or less!) than the standard plug-ins, you need to set the +use more (or less!) than the standard plug-ins, you may set the environment variable GYOTO_PLUGINS to a comma-separated list of plug-ins. \fBgyoto\fR will exit with an error status if unable to load a specified plug-in, unless it is prefixed with "nofail:" in -GYOTO_PLUGINS. Default value: "stdplug,nofail:lorene". Gyoto attempts -to find plug-ins first by relying on the system's dynamic linker (so -paths in e.g. LD_LIBRARY_PATH and ld.so.conf are searched first). If -that fails, it looks in PREFIX/lib/gyoto/ and finally in +GYOTO_PLUGINS. This environment variable is overwritten byt he +\fB\-\-plugins\fR command-line parameter. Default value: +"stdplug,nofail:lorene". Gyoto attempts to find plug-ins first by +relying on the system's dynamic linker (so paths in +e.g. LD_LIBRARY_PATH and ld.so.conf are searched first). If that +fails, it looks in PREFIX/lib/gyoto/ and finally in PREFIX/lib/gyoto/SOVERS/ where PREFIX and SOVERS are two compile-time options. PREFIX usually is /usr/local or /usr. At the time of writing, SOVERS is 0.0.0. diff -Nru gyoto-0.0.3/bin/gyoto.C gyoto-0.1.0/bin/gyoto.C --- gyoto-0.0.3/bin/gyoto.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/bin/gyoto.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard, Frederic Vincent + Copyright 2011, 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. @@ -17,13 +17,22 @@ along with Gyoto. If not, see . */ +// Gyoto +#include "GyotoDefs.h" #include "GyotoFactory.h" #include "GyotoUtils.h" #include "GyotoRegister.h" -#include "GyotoDefs.h" + +// FITS I/O #include + +// signal() #include +// getpid() +#include +#include + using namespace std; using namespace Gyoto; @@ -58,14 +67,13 @@ static std::string curmsg = ""; static int curretval = 1; -void gyotoErrorHandler( const char *msg ) { - cerr << curmsg << msg << endl; +void gyotoErrorHandler( const Gyoto::Error e ) { + cerr << curmsg << e << endl; if (debug()) abort(); // to keep stack for debugger exit (curretval); } int main(int argc, char** argv) { - /* This program aims at computing the null geodesics of photons from an observation screen to an astrophysical object (star orbit, @@ -82,16 +90,20 @@ size_t imin=1, imax=1000000000, jmin=1, jmax=1000000000; // double tobs, tmin, fov, dist, paln, incl, arg; - double tobs, fov, dist, paln, incl, arg; - size_t res; + double tobs=0., tmin=0., fov=0., dist=0., paln=0., incl=0., arg=0.; + size_t res=0, nthreads=0; // bool xtobs=0, xtmin=0, xfov=0, xres=0, xdist=0, xpaln=0, xincl=0, xarg=0; - bool xtobs=0, xfov=0, xres=0, xdist=0, xpaln=0, xincl=0, xarg=0; + bool xtobs=0, xtmin=0, xfov=0, xres=0, xdist=0, xpaln=0, xincl=0, xarg=0, xnthreads=0; bool ipct=0; long ipctdims[3]={0, 0, 0}; double ipcttime; - int i, stop=0; - for (i=1;i0" << endl; + return 1; + } + } + else if (param.substr(0,7)=="--imax=") { + imax=atoi(param.substr(7).c_str()); + double imaxtest=atof(param.substr(7).c_str()); + if (imaxtest<=0){ + cerr << "In gyoto.C: screen indices should be >0" << endl; + return 1; + } + } + else if (param.substr(0,7)=="--jmin=") { + jmin=atoi(param.substr(7).c_str()); + double jmintest=atof(param.substr(7).c_str()); + if (jmintest<=0){ + cerr << "In gyoto.C: screen indices should be >0" << endl; + return 1; + } + } + else if (param.substr(0,7)=="--jmax=") { + jmax=atoi(param.substr(7).c_str()); + double jmaxtest=atof(param.substr(7).c_str()); + if (jmaxtest<=0){ + cerr << "In gyoto.C: screen indices should be >0" << endl; + return 1; + } + } else if (param.substr(0,15)=="--impact-coords") { if (param.size() > 16 && param.substr(15,1)=="=") ipctfile=param.substr(16); @@ -112,9 +156,9 @@ else if (param.substr(0,7)=="--time=") { tobs=atof(param.substr(7).c_str()); xtobs=1; - /*} else if (param.substr(0,7)=="--tmin=") { + } else if (param.substr(0,7)=="--tmin=") { tmin=atof(param.substr(7).c_str()); - xtmin=1;*/ + xtmin=1; } else if (param.substr(0,6)=="--fov=") { fov=atof(param.substr(6).c_str()); xfov=1; @@ -133,7 +177,10 @@ } else if (param.substr(0,11)=="--argument=") { arg=atof(param.substr(11).c_str()); xarg=1; - } + } else if (param.substr(0,11)=="--nthreads=") { + nthreads=atoi(param.substr(11).c_str()); + xnthreads=1; + } else { usage(); return 1; @@ -161,15 +208,16 @@ << " properly \n acknowledged. Please cite:\n" << " GYOTO: a new general relativistic ray-tracing code,\n" << " F. H. Vincent, T. Paumard, E. Gourgoulhon & G. Perrin 2011,\n" - << " Classical and Quantum Gravity, accepted. [arXiv:1109.4769]" + << " Classical and Quantum Gravity 28, 225011 (2011) " + << "[arXiv:1109.4769]" << endl << endl; // set-up error reporter - Gyoto::setErrorHandler ( &gyotoErrorHandler ); + Gyoto::Error::setHandler ( &gyotoErrorHandler ); curmsg = "In gyoto.C: Error initializing libgyoto: "; curretval = 1; - Gyoto::Register::init(); + Gyoto::Register::init(pluglist.c_str()); Factory *factory ; if (verbose() >= GYOTO_QUIET_VERBOSITY) cout << "Reading parameter file: " << parfile << endl; @@ -189,7 +237,7 @@ if (xtobs) screen -> setTime ( tobs ); else tobs= screen -> getTime(); - // if (xtmin) screen -> setMinimumTime ( tmin ); + if (xtmin) scenery -> setTmin ( tmin ); if (xres) screen -> setResolution ( res ); else res = screen -> getResolution(); if (xfov) screen -> setFieldOfView ( fov ); @@ -197,6 +245,7 @@ if (xincl) screen -> setInclination ( incl ); if (xpaln) screen -> setPALN ( paln ); if (xarg) screen -> setArgument ( arg ); + if (xnthreads) scenery -> setNThreads ( nthreads ); if (ipctfile != "") { // if (verbose() >= GYOTO_QUIET_VERBOSITY) @@ -230,7 +279,7 @@ double dt = tobs * GYOTO_C / scenery -> getMetric() -> unitLength() - ipcttime; - for (i=0; i < ipctnelt; i+=8) + for (size_t i=0; i < ipctnelt; i+=8) if (impactcoords[i] != DBL_MAX) impactcoords[i] += dt; ipcttime = tobs * GYOTO_C / scenery -> getMetric() -> unitLength(); } @@ -241,7 +290,7 @@ size_t nbnuobs=0; if (quantities & (GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_BINSPECTRUM)) { - SmartPointer spr = screen -> getSpectrometer(); + SmartPointer spr = screen -> getSpectrometer(); if (!spr) throwError("Spectral quantity requested but " "no spectrometer specified!"); nbnuobs = spr -> getNSamples(); @@ -254,8 +303,8 @@ vect = new double[nelt]; // First check whether we can open file - long naxis=3; - long naxes[] = {res, res, nbdata+nbnuobs}; + int naxis=3; + long naxes[] = {long(res), long(res), long(nbdata+nbnuobs)}; nelements=nelt; fits_create_file(&fptr, pixfile, &status); @@ -360,7 +409,7 @@ } if (quantities & GYOTO_QUANTITY_SPECTRUM) { data->spectrum=vect+offset*(curquant++); - data->offset=offset; + data->offset=int(offset); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("Spectrum"), @@ -368,7 +417,7 @@ } if (quantities & GYOTO_QUANTITY_BINSPECTRUM) { data->binspectrum=vect+offset*(curquant++); - data->offset=offset; + data->offset=int(offset); sprintf(keyname, fmt, curquant); fits_write_key(fptr, TSTRING, keyname, const_cast("BinSpectrum"), @@ -393,7 +442,7 @@ if (quantities & GYOTO_QUANTITY_IMPACTCOORDS || ipct) { // Save if requested, copying if provided cout << "Saving precomputed impact coordinates" << endl; - long naxes_ipct[] = {16, res, res}; + long naxes_ipct[] = {16, long(res), long(res)}; fits_create_img(fptr, DOUBLE_IMG, naxis, naxes_ipct, &status); fits_write_key(fptr, TSTRING, const_cast("EXTNAME"), const_cast("Gyoto Impact Coordinates"), diff -Nru gyoto-0.0.3/config.guess gyoto-0.1.0/config.guess --- gyoto-0.0.3/config.guess 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/config.guess 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru gyoto-0.0.3/config.h.in gyoto-0.1.0/config.h.in --- gyoto-0.0.3/config.h.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/config.h.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,105 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Enable debugging information gathering code for putative speed gain */ +#undef GYOTO_DEBUG_ENABLED + +/* Suffix for Gyoto plug-ins */ +#undef GYOTO_PLUGIN_SFX + +/* Gyoto ABI version */ +#undef GYOTO_SOVERS + +/* Define to 1 if you have cfitsio */ +#undef GYOTO_USE_CFITSIO + +/* Define to 1 if you have Lorene */ +#undef GYOTO_USE_LORENE + +/* Define to 1 if you have Xerces */ +#undef GYOTO_USE_XERCES + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Define to 1 if you have the `sincos' function. */ +#undef HAVE_SINCOS + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have libudunits2 */ +#undef HAVE_UDUNITS + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff -Nru gyoto-0.0.3/config.sub gyoto-0.1.0/config.sub --- gyoto-0.0.3/config.sub 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/config.sub 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,1782 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-04-18' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru gyoto-0.0.3/configure gyoto-0.1.0/configure --- gyoto-0.0.3/configure 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/configure 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,20479 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for Gyoto 0.1.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: gyoto@sympa.obspm.fr about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='Gyoto' +PACKAGE_TARNAME='gyoto' +PACKAGE_VERSION='0.1.0' +PACKAGE_STRING='Gyoto 0.1.0' +PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' +PACKAGE_URL='' + +ac_unique_file="include/GyotoKerrKS.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +mySUBDIRS +pkg_libs +pkg_cflags +pkg_requires +LORENELDFLAGS +LORENECPPFLAGS +HAVE_LORENE_FALSE +HAVE_LORENE_TRUE +HOME_LORENE +MAKE_S +CFITSIOCPPFLAGS +CFITSIOLDFLAGS +HAVE_CFITSIO_FALSE +HAVE_CFITSIO_TRUE +CFITSIO_LIBS +CFITSIO_CFLAGS +XERCESCPPFLAGS +XERCESLDFLAGS +XERCES_LIBS +XERCES_CFLAGS +UDUNITS_CPPFLAGS +UDUNITS_LDFLAGS +UDUNITS_LIBS +UDUNITS_CFLAGS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config +POW_LIB +LIBOBJS +Y_INST_SITE +Y_INST_HOME +YORICK +plugin_sfx +SYS +DYLIB_VAR +DOXYGEN +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +sovers +VERSINFO +CXXCPP +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LIBTOOL +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_static +enable_shared +with_pic +enable_fast_install +enable_dependency_tracking +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_native +enable_hardening +with_yorick +with_yorick_home +with_yorick_site +enable_debugging +enable_pthreads +with_udunits +with_udunits_inc +with_udunits_lib +with_xerces +with_xerces_headers +with_xerces_libs +with_cfitsio +with_cfitsio_headers +with_cfitsio_libs +with_lorene +enable_doc +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP +CXXCPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +UDUNITS_CFLAGS +UDUNITS_LIBS +XERCES_CFLAGS +XERCES_LIBS +CFITSIO_CFLAGS +CFITSIO_LIBS +MAKE_S +HOME_LORENE' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures Gyoto 0.1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/gyoto] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of Gyoto 0.1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-static[=PKGS] build static libraries [default=no] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-native append "-march=native" to CXXFLAGS if supported + --enable-hardening add warnings and hardening flags if supported + --disable-debugging remove debugging code for hypothetical speed gain + --disable-pthreads disable POSIX threads parallelization + --disable-doc disable building documentation + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-yorick[=yorick-executable] + force using yorick and optionnally specify which one + [default=yorick, only if found] + --with-yorick-home=DIR architecture-dependent Yorick files [default: the + yorick directory if it is under ${exec_prefix}, else + ${exec_prefix}/lib/yorick] + --with-yorick-site=DIR architecture-independent Yorick files [default: the + yorick directory if it is under ${prefix}, else + ${prefix}/lib/yorick] + + --with-udunits[=DIR] Force using udunits2 installed in a given prefix or + force disable it. + --with-udunits-inc=DIR path to base directory with UDUNITS headers + --with-udunits-lib=LDFLAGS + linker flags for udunits + --with-xerces[=xerces-prefix] + Force using xerces installed in a given prefix or + force disable it. + --with-xerces-headers=path + location of xercesc include files (without trailing + "/xercesc") + --with-xerces-libs=path location of xercesc library files + --with-cfitsio[=cfitsio-prefix] + Force using cfitsio installed in a given prefix or + force disable it. + --with-cfitsio-headers=path + location of cfitsio include files + --with-cfitsio-libs=path + location of cfitsio library files + --with-lorene[=${HOME_LORENE}] + force using the optional LORENE library, possibly + specifying HOME_LORENE [default=${HOME_LORENE}] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + UDUNITS_CFLAGS + C compiler flags for UDUNITS, overriding pkg-config + UDUNITS_LIBS + linker flags for UDUNITS, overriding pkg-config + XERCES_CFLAGS + C compiler flags for XERCES, overriding pkg-config + XERCES_LIBS linker flags for XERCES, overriding pkg-config + CFITSIO_CFLAGS + C compiler flags for CFITSIO, overriding pkg-config + CFITSIO_LIBS + linker flags for CFITSIO, overriding pkg-config + MAKE_S make command which does not print directories [[make -w]] + HOME_LORENE path to Lorene build directory (see also --with-lorene) + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +Gyoto configure 0.1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_cxx_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_type + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_cxx_check_func LINENO FUNC VAR +# ------------------------------------ +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_cxx_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by Gyoto $as_me 0.1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +gyoto_test_CXXFLAGS=${CXXFLAGS+set} +gyoto_test_CPPFLAGS=${CPPFLAGS+set} +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='gyoto' + VERSION='0.1.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + 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]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_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'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options +enable_dlopen=yes +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=no +fi + + + + + + + + + + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + 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' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + 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' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + 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' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + 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" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + 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' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + 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}" + 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}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + 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' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + 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' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + 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~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + 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;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC="$lt_save_CC" + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$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" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$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' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$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' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $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' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="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}" + module_expsym_cmds_CXX="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}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$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}" + archive_expsym_cmds_CXX="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}" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$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' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + 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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + 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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='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' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='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' + archive_expsym_cmds_CXX='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' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + 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; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$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' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $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' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + + GCC_CXX="$GXX" + LD_CXX="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--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" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs_CXX=no + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + 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;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +ac_config_headers="$ac_config_headers config.h include/GyotoConfig.h" + + +VERSINFO=1:0:0 +sovers=`echo $VERSINFO | tr : .` + + + + +cat >>confdefs.h <<_ACEOF +#define GYOTO_SOVERS "${sovers}" +_ACEOF + + +# Checks for programs. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi +DOXYGEN= +for ac_prog in doxygen +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DOXYGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DOXYGEN"; then + ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DOXYGEN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DOXYGEN=$ac_cv_prog_DOXYGEN +if test -n "$DOXYGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 +$as_echo "$DOXYGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DOXYGEN" && break +done + + +# Provide additional defaults for user variables +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts " >&5 +$as_echo_n "checking whether C++ compiler accepts ... " >&6; } +if ${ax_cv_check_cxxflags__+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS " + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_check_cxxflags__=yes +else + ax_cv_check_cxxflags__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags__" >&5 +$as_echo "$ax_cv_check_cxxflags__" >&6; } +if test x"$ax_cv_check_cxxflags__" = xyes; then : + : +else + : +fi + +if ${CXXFLAGS+:} false; then : + case " $CXXFLAGS " in + *" "*) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains "; } >&5 + (: CXXFLAGS already contains ) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; + *) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \""; } >&5 + (: CXXFLAGS="$CXXFLAGS ") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + CXXFLAGS="$CXXFLAGS " + ;; + esac +else + CXXFLAGS="" +fi + +# Check whether --enable-native was given. +if test "${enable_native+set}" = set; then : + enableval=$enable_native; if test "x$enable_native" = "xyes"; then : + + +for flag in -march=native; do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : + if ${CXXFLAGS+:} false; then : + case " $CXXFLAGS " in + *" $flag "*) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 + (: CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; + *) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \$flag\""; } >&5 + (: CXXFLAGS="$CXXFLAGS $flag") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + CXXFLAGS="$CXXFLAGS $flag" + ;; + esac +else + CXXFLAGS="$flag" +fi + +else + : +fi + +done + +fi +fi + + +# Check whether --enable-hardening was given. +if test "${enable_hardening+set}" = set; then : + enableval=$enable_hardening; if test "x$enable_hardening" = "xyes"; then : + + +for flag in -pedantic -Wall -W -Wundef -Wshadow -Wcast-qual \ + -Wcast-align -Wconversion -Winline -Wabi -Woverloaded-virtual \ + -Wno-long-long -Wformat -Wformat-security -Werror=format-security \ + -fstack-protector "--param ssp-buffer-size=4"; do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : + if ${CXXFLAGS+:} false; then : + case " $CXXFLAGS " in + *" $flag "*) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 + (: CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; + *) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \$flag\""; } >&5 + (: CXXFLAGS="$CXXFLAGS $flag") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + CXXFLAGS="$CXXFLAGS $flag" + ;; + esac +else + CXXFLAGS="$flag" +fi + +else + : +fi + +done + + + +for flag in -D_FORTIFY_SOURCE=2; do + as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +if eval \${$as_CACHEVAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_CACHEVAR=yes" +else + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : + if ${CPPFLAGS+:} false; then : + case " $CPPFLAGS " in + *" $flag "*) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains \$flag"; } >&5 + (: CPPFLAGS already contains $flag) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; + *) + { { $as_echo "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS \$flag\""; } >&5 + (: CPPFLAGS="$CPPFLAGS $flag") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + CPPFLAGS="$CPPFLAGS $flag" + ;; + esac +else + CPPFLAGS="$flag" +fi + +else + : +fi + +done + + +fi + + +fi + + +# Guess *LD_LIBRARY_PATH variable for make check + +SYS=other +DYLIB_VAR=LD_LIBRARY_PATH +case "x$target_os" in + xdarwin*|xmacos) + DYLIB_VAR=DYLD_LIBRARY_PATH + SYS=Darwin + ;; + *) ;; +esac +plugin_sfx=so + +cat >>confdefs.h <<_ACEOF +#define GYOTO_PLUGIN_SFX "${plugin_sfx}" +_ACEOF + + +# Used in yorick/stdplug/Makefile + + + +# Check for Yorick +yorick_exe=yorick +YORICK= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use yorick" >&5 +$as_echo_n "checking whether to use yorick... " >&6; } + +# Check whether --with-yorick was given. +if test "${with_yorick+set}" = set; then : + withval=$with_yorick; if test "x$with_yorick" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + if test "x$with_yorick" != "xyes"; then : + YORICK=$with_yorick +else + YORICK=$yorick_exe +fi + if $YORICK -batch; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YORICK" >&5 +$as_echo "$YORICK" >&6; } +else + as_fn_error $? "$YORICK does not work" "$LINENO" 5 +fi + +fi + + +else + for ac_prog in $yorick_exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YORICK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YORICK"; then + ac_cv_prog_YORICK="$YORICK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YORICK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YORICK=$ac_cv_prog_YORICK +if test -n "$YORICK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YORICK" >&5 +$as_echo "$YORICK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YORICK" && break +done + + +fi + + +# Only if YORICK available, check for install directories +if test "x$YORICK" != "x"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking install path for Yorick platform-dependent files" >&5 +$as_echo_n "checking install path for Yorick platform-dependent files... " >&6; } + Y_EXE_HOME=`echo write,format=\"%s\",Y_HOME\; quit | ${YORICK}| tail -1` + Y_EXE_SITE=`echo write,format=\"%s\",Y_SITE\; quit | ${YORICK}| tail -1` + Y_INST_HOME= + Y_INST_SITE= + +# Check whether --with-yorick-home was given. +if test "${with_yorick_home+set}" = set; then : + withval=$with_yorick_home; Y_INST_HOME=${with_yorick_home} + Y_INST_SITE=${with_yorick_home} + +else + if echo ${Y_EXE_HOME} | grep ${exec_prefix}; then : + Y_INST_HOME=Y_EXE_HOME + Y_INST_SITE=Y_EXE_SITE +else + Y_INST_HOME='${exec_prefix}/lib/yorick' + Y_INST_SITE='${prefix}/lib/yorick' + +fi +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Y_INST_HOME" >&5 +$as_echo "$Y_INST_HOME" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking install path for Yorick platform-independent files" >&5 +$as_echo_n "checking install path for Yorick platform-independent files... " >&6; } + +# Check whether --with-yorick-site was given. +if test "${with_yorick_site+set}" = set; then : + withval=$with_yorick_site; Y_INST_SITE=${with_yorick_site} +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Y_INST_SITE" >&5 +$as_echo "$Y_INST_SITE" >&6; } + + + + +fi + +# Checks for libraries. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + + +# Checks for header files. +# We are not using those tests to far +# AC_CHECK_HEADERS([float.h stddef.h string.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +$as_echo_n "checking for error_at_line... " >&6; } +if ${ac_cv_lib_error_at_line+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +error_at_line (0, 0, "", 0, "an error occurred"); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_error_at_line=yes +else + ac_cv_lib_error_at_line=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +$as_echo "$ac_cv_lib_error_at_line" >&6; } +if test $ac_cv_lib_error_at_line = no; then + case " $LIBOBJS " in + *" error.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS error.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if ${ac_cv_func_strtod+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_cxx_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +# other functions we may need to check for according to autoscan: +# floor getcwd pow sqrt strdup +for ac_func in sincos +do : + ac_fn_cxx_check_func "$LINENO" "sincos" "ac_cv_func_sincos" +if test "x$ac_cv_func_sincos" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SINCOS 1 +_ACEOF + +fi +done + + +pkg_requires= +pkg_cflags= +pkg_libs= + +# Enable debugging by default +GYOTO_DEBUG_ENABLED=yes +# Check whether --enable-debugging was given. +if test "${enable_debugging+set}" = set; then : + enableval=$enable_debugging; if test "x$enable_debugging" == "xno"; then : + GYOTO_DEBUG_ENABLED=0 +fi + +fi + +if test "x$GYOTO_DEBUG_ENABLED" == xyes; then : + +$as_echo "#define GYOTO_DEBUG_ENABLED 1" >>confdefs.h + + + +fi + +# Check for pthreads +use_pthreads=yes +# Check whether --enable-pthreads was given. +if test "${enable_pthreads+set}" = set; then : + enableval=$enable_pthreads; if test "x$enable_pthreads" = "xno"; then : + use_pthreads=no +fi +fi + +if test "x$use_pthreads" = "xyes"; then : + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr = $attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + attr_name=$attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +$as_echo "${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : + +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + +fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" + + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi + +# Check for UDUNITS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libudunits2 should be used" >&5 +$as_echo_n "checking whether libudunits2 should be used... " >&6; } +udunits_cppflags= +udunits_ldflags= +UDUNITS_CPPFLAGS= +UDUNITS_LDFLAGS= + +# Check whether --with-udunits was given. +if test "${with_udunits+set}" = set; then : + withval=$with_udunits; + if test "x$withval" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +elif test "x$withval" != "xyes"; then : + udunits_cppflags=-I$withval/include + udunits_ldflags="-L$withval/lib -ludunits2" + with_udunits=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + +else + with_udunits=check + { $as_echo "$as_me:${as_lineno-$LINENO}: result: probe" >&5 +$as_echo "probe" >&6; } + + +fi + +have_udunits=no +if test "x$with_udunits" != "xno"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether udunits2 include path is provided" >&5 +$as_echo_n "checking whether udunits2 include path is provided... " >&6; } + +# Check whether --with-udunits-inc was given. +if test "${with_udunits_inc+set}" = set; then : + withval=$with_udunits_inc; with_udunits=yes + udunits_cppflags=-I${withval} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${withval}" >&5 +$as_echo "${withval}" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether udunits linker flags are provided" >&5 +$as_echo_n "checking whether udunits linker flags are provided... " >&6; } + +# Check whether --with-udunits-lib was given. +if test "${with_udunits_lib+set}" = set; then : + withval=$with_udunits_lib; with_udunits=yes + udunits_ldflags="${withval}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Now check whether or not to use pkg-config for udunits + if test "x$udunits_cppflags" == "x" \ + && test "x$udunits_ldflags" == "x" \ + && test "x$PKG_CONFIG" != "x"; then : + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDUNITS" >&5 +$as_echo_n "checking for UDUNITS... " >&6; } + +if test -n "$UDUNITS_CFLAGS"; then + pkg_cv_UDUNITS_CFLAGS="$UDUNITS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udunits\""; } >&5 + ($PKG_CONFIG --exists --print-errors "udunits") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UDUNITS_CFLAGS=`$PKG_CONFIG --cflags "udunits" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$UDUNITS_LIBS"; then + pkg_cv_UDUNITS_LIBS="$UDUNITS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udunits\""; } >&5 + ($PKG_CONFIG --exists --print-errors "udunits") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UDUNITS_LIBS=`$PKG_CONFIG --libs "udunits" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + UDUNITS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udunits" 2>&1` + else + UDUNITS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udunits" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$UDUNITS_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: udunits.pc not found" >&5 +$as_echo "$as_me: udunits.pc not found" >&6;} + + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: udunits.pc not found" >&5 +$as_echo "$as_me: udunits.pc not found" >&6;} + + +else + UDUNITS_CFLAGS=$pkg_cv_UDUNITS_CFLAGS + UDUNITS_LIBS=$pkg_cv_UDUNITS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + pkg_requires="${pkg_requires} udunits" + have_udunits=yes + UDUNITS_CPPFLAGS=${UDUNITS_CFLAGS} + UDUNITS_LDFLAGS=${UDUNITS_LIBS} + +fi + +fi + + # Failing that, check without pkg-config + if test "x$have_udunits" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udunits (without pkg-config)" >&5 +$as_echo_n "checking for udunits (without pkg-config)... " >&6; } + TMPCPPFLAGS=$CPPFLAGS + TMPCFLAGS=$CFLAGS + TMPLDFLAGS=$LDFLAGS + TMPLIBS=$LIBS + CPPFLAGS="$TMPCPPFLAGS $udunits_cppflags" + LDFLAGS="$TMPLDFLAGS $udunits_ldflags" + LIBS=-ludunits2 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +ut_set_error_message_handler(ut_ignore); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_udunits=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$TMPCPPFLAGS + LDFLAGS=$TMPLDFLAGS + LIBS=$TMPLIBS + UDUNITS_LDFLAGS="$udunits_ldflags -ludunits2" + UDUNITS_CPPFLAGS="$udunits_cppflags" + pkg_cflags="${pkg_cflags} ${UDUNITS_CPPFLAGS}" + pkg_libs="${pkg_libs} ${UDUNITS_LDFLAGS}" + +fi + +fi +if test "x$have_udunits" == "xno"; then : + + if test "x$with_udunits" == "xyes"; then : + as_fn_error $? " + **************************************** + *** UDUNITS requested but not found! *** + ****************************************" "$LINENO" 5 + + +fi + +else + use_udunits=yes + +$as_echo "#define HAVE_UDUNITS 1" >>confdefs.h + + +fi + + + + +# Check for Xerces-c +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libxerces should be used" >&5 +$as_echo_n "checking whether libxerces should be used... " >&6; } +xerces_headers= +xerces_lib= +XERCESCPPFLAGS= +XERCESLDFLAGS= + +# Check whether --with-xerces was given. +if test "${with_xerces+set}" = set; then : + withval=$with_xerces; + if test "x$with_xerces" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +elif test "x$with_xerces" != "xyes"; then : + xerces_headers=-I$with_xerces/include + xerces_lib=-L$with_xerces/lib + with_xerces=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + +else + with_xerces=check + { $as_echo "$as_me:${as_lineno-$LINENO}: result: probe" >&5 +$as_echo "probe" >&6; } + + +fi + +have_xerces=no +if test "x$with_xerces" != "xno"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xerces include path is provided" >&5 +$as_echo_n "checking whether xerces include path is provided... " >&6; } + +# Check whether --with-xerces-headers was given. +if test "${with_xerces_headers+set}" = set; then : + withval=$with_xerces_headers; with_xerces=yes + xerces_headers=-I${with_xerces_headers} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_xerces_headers}" >&5 +$as_echo "${with_xerces_headers}" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xerces library path is provided" >&5 +$as_echo_n "checking whether xerces library path is provided... " >&6; } + +# Check whether --with-xerces-libs was given. +if test "${with_xerces_libs+set}" = set; then : + withval=$with_xerces_libs; with_xerces=yes + xerces_lib=-L$with_xerces_libs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xerces_libs" >&5 +$as_echo "$with_xerces_libs" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Now check whether or not to use pkg-config for xerces + if test "x$xerces_headers" == "x" \ + && test "x$xerces_lib" == "x" \ + && test "x$PKG_CONFIG" != "x"; then : + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XERCES" >&5 +$as_echo_n "checking for XERCES... " >&6; } + +if test -n "$XERCES_CFLAGS"; then + pkg_cv_XERCES_CFLAGS="$XERCES_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xerces-c\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xerces-c") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XERCES_CFLAGS=`$PKG_CONFIG --cflags "xerces-c" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$XERCES_LIBS"; then + pkg_cv_XERCES_LIBS="$XERCES_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xerces-c\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xerces-c") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XERCES_LIBS=`$PKG_CONFIG --libs "xerces-c" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + XERCES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xerces-c" 2>&1` + else + XERCES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xerces-c" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$XERCES_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: xerces-c.pc not found" >&5 +$as_echo "$as_me: xerces-c.pc not found" >&6;} + + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: xerces-c.pc not found" >&5 +$as_echo "$as_me: xerces-c.pc not found" >&6;} + + +else + XERCES_CFLAGS=$pkg_cv_XERCES_CFLAGS + XERCES_LIBS=$pkg_cv_XERCES_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + pkg_requires="${pkg_requires} xerces-c" + have_xerces=yes + XERCESCPPFLAGS=${XERCES_CFLAGS} + XERCESLDFLAGS=${XERCES_LIBS} + +fi + +fi + + # Failing that, check without pkg-config + if test "x$have_xerces" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xerces-c (without pkg-config)" >&5 +$as_echo_n "checking for xerces-c (without pkg-config)... " >&6; } + TMPCPPFLAGS=$CPPFLAGS + TMPCFLAGS=$CFLAGS + TMPLDFLAGS=$LDFLAGS + TMPLIBS=$LIBS + CPPFLAGS="$TMPCPPFLAGS $xerces_headers" + LDFLAGS="$TMPLDFLAGS $xerces_lib" + LIBS=-lxerces-c + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +xercesc::XMLPlatformUtils::Initialize(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_xerces=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$TMPCPPFLAGS + LDFLAGS=$TMPLDFLAGS + LIBS=$TMPLIBS + XERCESLDFLAGS="$xerces_lib -lxerces-c" + XERCESCPPFLAGS="$xerces_headers" + pkg_cflags="${pkg_cflags} ${XERCESCPPFLAGS}" + pkg_libs="${pkg_libs} ${XERCESLDFLAGS}" + +fi + +fi +if test "x$have_xerces" == "xno"; then : + + if test "x$with_xerces" == "xyes"; then : + as_fn_error $? "xerces requested but not found" "$LINENO" 5 + + +fi + +else + use_xerces=yes + +$as_echo "#define GYOTO_USE_XERCES 1" >>confdefs.h + + +fi + + + +# Check for CFITSIO +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcfitsio should be used" >&5 +$as_echo_n "checking whether libcfitsio should be used... " >&6; } +cfitsio_headers= +cfitsio_lib= + +# Check whether --with-cfitsio was given. +if test "${with_cfitsio+set}" = set; then : + withval=$with_cfitsio; + if test "x$with_cfitsio" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +elif test "x$with_cfitsio" != "xyes"; then : + cfitsio_headers=-I$with_cfitsio/include + cfitsio_lib=-L$with_cfitsio/lib + with_cfitsio=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + +else + with_cfitsio=check + { $as_echo "$as_me:${as_lineno-$LINENO}: result: probe" >&5 +$as_echo "probe" >&6; } + + +fi + +have_cfitsio=no +if test "x$with_cfitsio" != "xno"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio include path is provided" >&5 +$as_echo_n "checking whether cfitsio include path is provided... " >&6; } + +# Check whether --with-cfitsio-headers was given. +if test "${with_cfitsio_headers+set}" = set; then : + withval=$with_cfitsio_headers; with_cfitsio=yes + cfitsio_headers=-I${with_cfitsio_headers} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_cfitsio_headers}" >&5 +$as_echo "${with_cfitsio_headers}" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio library path is provided" >&5 +$as_echo_n "checking whether cfitsio library path is provided... " >&6; } + +# Check whether --with-cfitsio-libs was given. +if test "${with_cfitsio_libs+set}" = set; then : + withval=$with_cfitsio_libs; with_cfitsio=yes + cfitsio_lib=-L$with_cfitsio_libs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cfitsio_libs" >&5 +$as_echo "$with_cfitsio_libs" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Now check whether or not to use pkg-config for cfitsio + if test "x$cfitsio_headers" == "x" \ + && test "x$cfitsio_lib" == "x" \ + && test "x$PKG_CONFIG" != "x"; then : + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFITSIO" >&5 +$as_echo_n "checking for CFITSIO... " >&6; } + +if test -n "$CFITSIO_CFLAGS"; then + pkg_cv_CFITSIO_CFLAGS="$CFITSIO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cfitsio\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cfitsio") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CFITSIO_CFLAGS=`$PKG_CONFIG --cflags "cfitsio" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CFITSIO_LIBS"; then + pkg_cv_CFITSIO_LIBS="$CFITSIO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cfitsio\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cfitsio") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CFITSIO_LIBS=`$PKG_CONFIG --libs "cfitsio" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CFITSIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cfitsio" 2>&1` + else + CFITSIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cfitsio" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CFITSIO_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: cfitsio.pc not found" >&5 +$as_echo "$as_me: cfitsio.pc not found" >&6;} + + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: cfitsio.pc not found" >&5 +$as_echo "$as_me: cfitsio.pc not found" >&6;} + + +else + CFITSIO_CFLAGS=$pkg_cv_CFITSIO_CFLAGS + CFITSIO_LIBS=$pkg_cv_CFITSIO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + pkg_requires="${pkg_requires} cfitsio" + have_cfitsio=yes + CFITSIOCPPFLAGS=${CFITSIO_CFLAGS} + CFITSIOLDFLAGS=${CFITSIO_LIBS} + +fi + +fi + + # Failing that, check without pkg-config + if test "x$have_cfitsio" == "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfitsio (without pkg-config)" >&5 +$as_echo_n "checking for cfitsio (without pkg-config)... " >&6; } + TMPCPPFLAGS=$CPPFLAGS + CPPFLAGS="$TMPCPPFLAGS $cfitsio_headers" + TMPLDFLAGS=$LDFLAGS + LDFLAGS="$TMPLDFLAGS $cfitsio_lib" + TMPLIBS=$LIBS + LIBS=-lcfitsio + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ +fitsfile* fptr=NULL; std::string file=""; int status=0; + fits_open_file(&fptr, file.c_str(), 0, &status); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_cfitsio=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$TMPCPPFLAGS + LDFLAGS=$TMPLDFLAGS + LIBS=$TMPLIBS + CFITSIOLDFLAGS="$cfitsio_lib -lcfitsio" + CFITSIOCPPFLAGS="$cfitsio_headers" + pkg_cflags="${pkg_cflags} ${CFITSIOCPPFLAGS}" + pkg_libs="${pkg_libs} ${CFITSIOLDFLAGS}" + + +fi + +fi +if test "x$have_cfitsio" == "xno"; then : + if test "x$with_cfitsio" == "xyes"; then : + as_fn_error $? "cfitsio requested but not found" "$LINENO" 5 + + +fi + +else + use_cfitsio=yes + +$as_echo "#define GYOTO_USE_CFITSIO 1" >>confdefs.h + + + +fi + if test "x$have_cfitsio" == "xyes"; then + HAVE_CFITSIO_TRUE= + HAVE_CFITSIO_FALSE='#' +else + HAVE_CFITSIO_TRUE='#' + HAVE_CFITSIO_FALSE= +fi + + + + +# Check for LORENE +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LORENE" >&5 +$as_echo_n "checking for LORENE... " >&6; } + +if test "x$MAKE_S" = "x"; then : + MAKE_S="make -s" +fi + +# first check whether LORENE is required and get HOME_LORENE +require_lorene=no + +# Check whether --with-lorene was given. +if test "${with_lorene+set}" = set; then : + withval=$with_lorene; if test "x$with_lorene" == "xno"; then : + HOME_LORENE="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +elif test "x$with_lorene" == "xyes"; then : + require_lorene=yes + if test "x$HOME_LORENE" != "x"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOME_LORENE" >&5 +$as_echo "$HOME_LORENE" >&6; } +else + as_fn_error $? "--with-lorene passed with no path: please specify LORENE + path either using the HOME_LORENE environment variable + or --with-lorene=." "$LINENO" 5 +fi + +else + require_lorene=yes + HOME_LORENE="$with_lorene" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOME_LORENE" >&5 +$as_echo "$HOME_LORENE" >&6; } + +fi + +else + if test "x$HOME_LORENE" != "x"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOME_LORENE" >&5 +$as_echo "$HOME_LORENE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +# then check whether LORENE is actually installed in HOME_LORENE +# finally output HOME_LORENE + + if test "x$HOME_LORENE" != "x"; then + HAVE_LORENE_TRUE= + HAVE_LORENE_FALSE='#' +else + HAVE_LORENE_TRUE='#' + HAVE_LORENE_FALSE= +fi + +if test "x$HOME_LORENE" != "x"; then : + + if test ! -r ${HOME_LORENE}/local_settings; then : + as_fn_error $? "${HOME_LORENE}/local_settings not found" "$LINENO" 5 +fi +cat >conftest.make <<_ACEOF +include \$(HOME_LORENE)/local_settings +conftest.make: + touch conftest.make + +%: conftest.make + @echo \$(\$@) +_ACEOF + LORENELDFLAGS="-L$HOME_LORENE/Lib -llorene -llorenef77" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LAPACK | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_GSL | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_PGPLOT | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LORENE | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_CXX | tr -d '\n\r'`" + LORENECPPFLAGS=`$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make INC | tr -d '\n\r'` + LORENECPPFLAGS="$LORENECPPFLAGS" + +$as_echo "#define GYOTO_USE_LORENE 1" >>confdefs.h + + rm conftest.make + + + pkg_cflags="${pkg_cflags} ${LORENECPPFLAGS}" + pkg_libss="${pkg_libss} ${LORENELDFLAGS}" + + + +fi + +# disable doc +# Check whether --enable-doc was given. +if test "${enable_doc+set}" = set; then : + enableval=$enable_doc; if test "x$enable_doc" == "xyes"; then : + mkdoc=yes +elif test "x$enable_doc" == "xno"; then : + mkdoc=no +else + as_fn_error $? "Please set --disable-doc or --enable-doc only to \`\`yes'' or \`\`no''" "$LINENO" 5 +fi + +else + mkdoc=yes +fi + + +# Finalization: select output files, subdirs etc. + + + +mySUBDIRS="lib" +if test "x$use_xerces" != "x" && test "x$use_cfitsio" != "x"; then : + mySUBDIRS="$mySUBDIRS bin" +fi +ac_config_files="$ac_config_files Makefile bin/Makefile doc/Makefile lib/Makefile lib/gyoto.pc lib/gyoto-uninstalled.pc" + +if test "x$YORICK" != "x"; then : + mySUBDIRS="$mySUBDIRS yorick" + ac_config_files="$ac_config_files yorick/Makefile" + + ac_config_files="$ac_config_files yorick/stdplug/Makefile" + + ac_config_files="$ac_config_files yorick/gyoto.info" + + + +fi +if test "x$DOXYGEN" != "x" && test "x$mkdoc" == "xyes"; then : + mySUBDIRS="$mySUBDIRS doc" +fi + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CFITSIO_TRUE}" && test -z "${HAVE_CFITSIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CFITSIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LORENE_TRUE}" && test -z "${HAVE_LORENE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LORENE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by Gyoto $as_me 0.1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +Gyoto config.status 0.1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + +YORICK=$YORICK +YORICK=$YORICK + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "include/GyotoConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/GyotoConfig.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "lib/gyoto.pc") CONFIG_FILES="$CONFIG_FILES lib/gyoto.pc" ;; + "lib/gyoto-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES lib/gyoto-uninstalled.pc" ;; + "yorick/Makefile") CONFIG_FILES="$CONFIG_FILES yorick/Makefile" ;; + "yorick/stdplug/Makefile") CONFIG_FILES="$CONFIG_FILES yorick/stdplug/Makefile" ;; + "yorick/gyoto.info") CONFIG_FILES="$CONFIG_FILES yorick/gyoto.info" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="CXX " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + "yorick/Makefile":F) oldpwd=`pwd` + cd yorick + $YORICK -batch make.i + cd $oldpwd ;; + "yorick/stdplug/Makefile":F) oldpwd=`pwd` + cd yorick/stdplug + $YORICK -batch make.i + cd $oldpwd ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + +if test "x$have_xerces" == "xno" || test "x$have_cfitsio" == "xno" ; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + + Building without xerces-c and/or cfitsio. + + *** The gyoto executable will not be built! *** + + Gyoto can still be used as a C++ library and through the Yorick plug-in + (although without XML support and/or without certain object types). + " >&5 +$as_echo "$as_me: WARNING: + + Building without xerces-c and/or cfitsio. + + *** The gyoto executable will not be built! *** + + Gyoto can still be used as a C++ library and through the Yorick plug-in + (although without XML support and/or without certain object types). + " >&2;} + +fi +if test "x$have_udunits" == "xno"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + + Building without udunits + + *** Unit conversions disabled *** + + " >&5 +$as_echo "$as_me: WARNING: + + Building without udunits + + *** Unit conversions disabled *** + + " >&2;} + +fi diff -Nru gyoto-0.0.3/configure.ac gyoto-0.1.0/configure.ac --- gyoto-0.0.3/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/configure.ac 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,627 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([Gyoto], [0.1.0], [gyoto@sympa.obspm.fr]) +gyoto_test_CXXFLAGS=${CXXFLAGS+set} +gyoto_test_CPPFLAGS=${CPPFLAGS+set} +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE +AC_CONFIG_SRCDIR([include/GyotoKerrKS.h]) +AC_CONFIG_MACRO_DIR([m4]) +AC_LANG(C++) +LT_INIT([dlopen disable-static]) +AC_CONFIG_HEADERS([config.h include/GyotoConfig.h]) + +VERSINFO=1:0:0 +sovers=`echo $VERSINFO | tr : .` +AC_SUBST([VERSINFO]) +AC_SUBST([sovers]) + +AC_DEFINE_UNQUOTED([GYOTO_SOVERS], ["${sovers}"], [Gyoto ABI version]) + +# Checks for programs. +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG([]) +DOXYGEN= +AC_CHECK_PROGS([DOXYGEN], [doxygen]) + +# Provide additional defaults for user variables +AC_ARG_ENABLE([native], + [AC_HELP_STRING([--enable-native], + [append "-march=native" to CXXFLAGS if supported])], + [AS_IF([test "x$enable_native" = "xyes"], + [AX_APPEND_COMPILE_FLAGS([[-march=native]])])]) + +AC_ARG_ENABLE([hardening], + [AS_HELP_STRING([--enable-hardening], + [add warnings and hardening flags if supported])], + [AS_IF([test "x$enable_hardening" = "xyes"], + [AX_APPEND_COMPILE_FLAGS([-pedantic -Wall -W -Wundef -Wshadow -Wcast-qual \ + -Wcast-align -Wconversion -Winline -Wabi -Woverloaded-virtual \ + -Wno-long-long -Wformat -Wformat-security -Werror=format-security \ + -fstack-protector "--param ssp-buffer-size=4"]) + AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2], [CPPFLAGS]) + ]) + ] +) + +# Guess *LD_LIBRARY_PATH variable for make check +AC_SUBST([target_os]) +SYS=other +DYLIB_VAR=LD_LIBRARY_PATH +case "x$target_os" in + xdarwin*|xmacos) + DYLIB_VAR=DYLD_LIBRARY_PATH + SYS=Darwin + ;; + *) ;; +esac +plugin_sfx=so +AC_DEFINE_UNQUOTED([GYOTO_PLUGIN_SFX],["${plugin_sfx}"], + [Suffix for Gyoto plug-ins]) +AC_SUBST([DYLIB_VAR]) +# Used in yorick/stdplug/Makefile +AC_SUBST([SYS]) +AC_SUBST([plugin_sfx]) + +# Check for Yorick +yorick_exe=yorick +YORICK= +AC_MSG_CHECKING([whether to use yorick]) +AC_ARG_WITH([yorick], + [AC_HELP_STRING([--with-yorick[[=yorick-executable]]], + [force using yorick and optionnally specify which one [default=yorick, + only if found]])], + [AS_IF([test "x$with_yorick" == "xno"], + [AC_MSG_RESULT([no])], + [AS_IF([test "x$with_yorick" != "xyes"], + [YORICK=$with_yorick], + [YORICK=$yorick_exe]) + AS_IF([$YORICK -batch], + [AC_MSG_RESULT([$YORICK])], + [AC_MSG_ERROR([$YORICK does not work])]) + ]) + AC_SUBST([YORICK]) + ], + [AC_CHECK_PROGS([YORICK],$yorick_exe)] +) + +# Only if YORICK available, check for install directories +AS_IF([test "x$YORICK" != "x"], + [AC_MSG_CHECKING([install path for Yorick platform-dependent files]) + Y_EXE_HOME=`echo write,format=\"%s\",Y_HOME\; quit | ${YORICK}| tail -1` + Y_EXE_SITE=`echo write,format=\"%s\",Y_SITE\; quit | ${YORICK}| tail -1` + Y_INST_HOME= + Y_INST_SITE= + AC_ARG_WITH([yorick-home], + [AC_HELP_STRING([--with-yorick-home=DIR], + [architecture-dependent Yorick files [default: the + yorick directory if it is under ${exec_prefix}, else + ${exec_prefix}/lib/yorick]])], + [Y_INST_HOME=${with_yorick_home} + Y_INST_SITE=${with_yorick_home} + ], + [AS_IF([echo ${Y_EXE_HOME} | grep ${exec_prefix}], + [Y_INST_HOME=Y_EXE_HOME + Y_INST_SITE=Y_EXE_SITE], + [Y_INST_HOME='${exec_prefix}/lib/yorick' + Y_INST_SITE='${prefix}/lib/yorick'] + )]) + AC_MSG_RESULT([$Y_INST_HOME]) + AC_SUBST([Y_INST_HOME]) + + AC_MSG_CHECKING([install path for Yorick platform-independent files]) + AC_ARG_WITH([yorick-site], + [AC_HELP_STRING([--with-yorick-site=DIR], + [architecture-independent Yorick files + [default: the yorick directory if it is under ${prefix}, else + ${prefix}/lib/yorick]]) + ], + [Y_INST_SITE=${with_yorick_site}]) + AC_MSG_RESULT([$Y_INST_SITE]) + AC_SUBST([Y_INST_SITE]) + + ] +) + +# Checks for libraries. +AC_CHECK_LIB([dl], [dlopen]) + +# Checks for header files. +# We are not using those tests to far +# AC_CHECK_HEADERS([float.h stddef.h string.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL +AC_TYPE_SIZE_T + +# Checks for library functions. +AC_FUNC_ERROR_AT_LINE +AC_FUNC_STRTOD +# other functions we may need to check for according to autoscan: +# floor getcwd pow sqrt strdup +AC_CHECK_FUNCS([sincos]) + +pkg_requires= +pkg_cflags= +pkg_libs= + +# Enable debugging by default +GYOTO_DEBUG_ENABLED=yes +AC_ARG_ENABLE([debugging], + [AS_HELP_STRING([--disable-debugging], + [remove debugging code for hypothetical speed gain])], + [AS_IF([test "x$enable_debugging" == "xno"], + [GYOTO_DEBUG_ENABLED=0]) + ]) +AS_IF([test "x$GYOTO_DEBUG_ENABLED" == xyes], + [AC_DEFINE([GYOTO_DEBUG_ENABLED], + [1], + [Enable debugging information gathering code for putative speed gain]) + ] +) + +# Check for pthreads +use_pthreads=yes +AC_ARG_ENABLE([pthreads], + [AS_HELP_STRING([--disable-pthreads], + [disable POSIX threads parallelization])], + [AS_IF([test "x$enable_pthreads" = "xno"], [use_pthreads=no])]) +AS_IF([test "x$use_pthreads" = "xyes"], [AX_PTHREAD]) + +# Check for UDUNITS +AC_MSG_CHECKING([whether libudunits2 should be used]) +udunits_cppflags= +udunits_ldflags= +UDUNITS_CPPFLAGS= +UDUNITS_LDFLAGS= +AC_ARG_WITH( + [udunits], + [AS_HELP_STRING( [--with-udunits[[=DIR]]], + [Force using udunits2 installed in a given prefix or force disable it.])], + [ + AS_IF([test "x$withval" == "xno"], + [AC_MSG_RESULT(no)], + [test "x$withval" != "xyes"], + [udunits_cppflags=-I$withval/include + udunits_ldflags="-L$withval/lib -ludunits2" + with_udunits=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(yes)]) + ], + [with_udunits=check + AC_MSG_RESULT(probe) + ] +) +have_udunits=no +AS_IF([test "x$with_udunits" != "xno"], + [ + AC_MSG_CHECKING(whether udunits2 include path is provided) + AC_ARG_WITH([udunits-inc], + [AS_HELP_STRING([--with-udunits-inc=DIR], + [path to base directory with UDUNITS headers])], + [with_udunits=yes + udunits_cppflags=-I${withval} + AC_MSG_RESULT([${withval}])], + [AC_MSG_RESULT([no])]) + AC_MSG_CHECKING(whether udunits linker flags are provided) + AC_ARG_WITH([udunits-lib], + [AS_HELP_STRING([--with-udunits-lib=LDFLAGS], + [linker flags for udunits])], + [with_udunits=yes + udunits_ldflags="${withval}" + AC_MSG_RESULT([$withval])], + [AC_MSG_RESULT([no])]) + + # Now check whether or not to use pkg-config for udunits + AS_IF([test "x$udunits_cppflags" == "x" \ + && test "x$udunits_ldflags" == "x" \ + && test "x$PKG_CONFIG" != "x"], + [PKG_CHECK_MODULES([UDUNITS], + [udunits], + [pkg_requires="${pkg_requires} udunits" + have_udunits=yes + UDUNITS_CPPFLAGS=${UDUNITS_CFLAGS} + UDUNITS_LDFLAGS=${UDUNITS_LIBS} + ], + [AC_MSG_NOTICE([udunits.pc not found]) + ] + ) + ], + []) + + # Failing that, check without pkg-config + AS_IF([test "x$have_udunits" == "xno"], + [AC_MSG_CHECKING([for udunits (without pkg-config)]) + TMPCPPFLAGS=$CPPFLAGS + TMPCFLAGS=$CFLAGS + TMPLDFLAGS=$LDFLAGS + TMPLIBS=$LIBS + CPPFLAGS="$TMPCPPFLAGS $udunits_cppflags" + LDFLAGS="$TMPLDFLAGS $udunits_ldflags" + LIBS=-ludunits2 + AC_TRY_LINK( + [#include ], + [ut_set_error_message_handler(ut_ignore);], + [have_udunits=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + CPPFLAGS=$TMPCPPFLAGS + LDFLAGS=$TMPLDFLAGS + LIBS=$TMPLIBS + UDUNITS_LDFLAGS="$udunits_ldflags -ludunits2" + UDUNITS_CPPFLAGS="$udunits_cppflags" + pkg_cflags="${pkg_cflags} ${UDUNITS_CPPFLAGS}" + pkg_libs="${pkg_libs} ${UDUNITS_LDFLAGS}" + ]) + ], + [] +) +AS_IF([test "x$have_udunits" == "xno"], + [ + AS_IF([test "x$with_udunits" == "xyes"], + [AC_MSG_ERROR([ + **************************************** + *** UDUNITS requested but not found! *** + ****************************************]) + ] + ) + ], + [use_udunits=yes + AC_DEFINE([HAVE_UDUNITS], [1], [Define to 1 if you have libudunits2])] +) +AC_SUBST([UDUNITS_LDFLAGS]) +AC_SUBST([UDUNITS_CPPFLAGS]) + + +# Check for Xerces-c +AC_MSG_CHECKING([whether libxerces should be used]) +xerces_headers= +xerces_lib= +XERCESCPPFLAGS= +XERCESLDFLAGS= +AC_ARG_WITH( + [xerces], + [AS_HELP_STRING( [--with-xerces[[=xerces-prefix]]], + [Force using xerces installed in a given prefix or force disable it.])], + [ + AS_IF([test "x$with_xerces" == "xno"], + [AC_MSG_RESULT(no)], + [test "x$with_xerces" != "xyes"], + [xerces_headers=-I$with_xerces/include + xerces_lib=-L$with_xerces/lib + with_xerces=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(yes)]) + ], + [with_xerces=check + AC_MSG_RESULT(probe) + ] +) +have_xerces=no +AS_IF([test "x$with_xerces" != "xno"], + [ + AC_MSG_CHECKING(whether xerces include path is provided) + AC_ARG_WITH([xerces-headers], + [AS_HELP_STRING([--with-xerces-headers=path], + [location of xercesc include files (without trailing "/xercesc")])], + [with_xerces=yes + xerces_headers=-I${with_xerces_headers} + AC_MSG_RESULT([${with_xerces_headers}])], + [AC_MSG_RESULT([no])]) + AC_MSG_CHECKING(whether xerces library path is provided) + AC_ARG_WITH([xerces-libs], + [AS_HELP_STRING([--with-xerces-libs=path], + [location of xercesc library files])], + [with_xerces=yes + xerces_lib=-L$with_xerces_libs + AC_MSG_RESULT([$with_xerces_libs])], + [AC_MSG_RESULT([no])]) + + # Now check whether or not to use pkg-config for xerces + AS_IF([test "x$xerces_headers" == "x" \ + && test "x$xerces_lib" == "x" \ + && test "x$PKG_CONFIG" != "x"], + [PKG_CHECK_MODULES([XERCES], + [xerces-c], + [pkg_requires="${pkg_requires} xerces-c" + have_xerces=yes + XERCESCPPFLAGS=${XERCES_CFLAGS} + XERCESLDFLAGS=${XERCES_LIBS} + ], + [AC_MSG_NOTICE([xerces-c.pc not found]) + ] + ) + ], + []) + + # Failing that, check without pkg-config + AS_IF([test "x$have_xerces" == "xno"], + [AC_MSG_CHECKING([for xerces-c (without pkg-config)]) + TMPCPPFLAGS=$CPPFLAGS + TMPCFLAGS=$CFLAGS + TMPLDFLAGS=$LDFLAGS + TMPLIBS=$LIBS + CPPFLAGS="$TMPCPPFLAGS $xerces_headers" + LDFLAGS="$TMPLDFLAGS $xerces_lib" + LIBS=-lxerces-c + AC_TRY_LINK( + [#include ], + [xercesc::XMLPlatformUtils::Initialize();], + [have_xerces=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + CPPFLAGS=$TMPCPPFLAGS + LDFLAGS=$TMPLDFLAGS + LIBS=$TMPLIBS + XERCESLDFLAGS="$xerces_lib -lxerces-c" + XERCESCPPFLAGS="$xerces_headers" + pkg_cflags="${pkg_cflags} ${XERCESCPPFLAGS}" + pkg_libs="${pkg_libs} ${XERCESLDFLAGS}" + ]) + ], + [] +) +AS_IF([test "x$have_xerces" == "xno"], + [ + AS_IF([test "x$with_xerces" == "xyes"], + [AC_MSG_ERROR([xerces requested but not found]) + ] + ) + ], + [use_xerces=yes + AC_DEFINE([GYOTO_USE_XERCES], [1], [Define to 1 if you have Xerces])] +) +AC_SUBST([XERCESLDFLAGS]) +AC_SUBST([XERCESCPPFLAGS]) + +# Check for CFITSIO +AC_MSG_CHECKING(whether libcfitsio should be used) +cfitsio_headers= +cfitsio_lib= +AC_ARG_WITH( + [cfitsio], + [AS_HELP_STRING( [--with-cfitsio[[=cfitsio-prefix]]], + [Force using cfitsio installed in a given prefix or force disable it.])], + [ + AS_IF([test "x$with_cfitsio" == "xno"], + [AC_MSG_RESULT(no)], + [test "x$with_cfitsio" != "xyes"], + [cfitsio_headers=-I$with_cfitsio/include + cfitsio_lib=-L$with_cfitsio/lib + with_cfitsio=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(yes)]) + ], + [with_cfitsio=check + AC_MSG_RESULT(probe) + ] +) +have_cfitsio=no +AS_IF([test "x$with_cfitsio" != "xno"], + [ + AC_MSG_CHECKING(whether cfitsio include path is provided) + AC_ARG_WITH([cfitsio-headers], + [AS_HELP_STRING([--with-cfitsio-headers=path], + [location of cfitsio include files])], + [with_cfitsio=yes + cfitsio_headers=-I${with_cfitsio_headers} + AC_MSG_RESULT([${with_cfitsio_headers}])], + [AC_MSG_RESULT([no])]) + AC_MSG_CHECKING(whether cfitsio library path is provided) + AC_ARG_WITH([cfitsio-libs], + [AS_HELP_STRING([--with-cfitsio-libs=path], + [location of cfitsio library files])], + [with_cfitsio=yes + cfitsio_lib=-L$with_cfitsio_libs + AC_MSG_RESULT([$with_cfitsio_libs])], + [AC_MSG_RESULT([no])]) + + # Now check whether or not to use pkg-config for cfitsio + AS_IF([test "x$cfitsio_headers" == "x" \ + && test "x$cfitsio_lib" == "x" \ + && test "x$PKG_CONFIG" != "x"], + [PKG_CHECK_MODULES([CFITSIO], + [cfitsio], + [pkg_requires="${pkg_requires} cfitsio" + have_cfitsio=yes + CFITSIOCPPFLAGS=${CFITSIO_CFLAGS} + CFITSIOLDFLAGS=${CFITSIO_LIBS} + ], + [AC_MSG_NOTICE([cfitsio.pc not found]) + ] + ) + ], + []) + + # Failing that, check without pkg-config + AS_IF([test "x$have_cfitsio" == "xno"], + [AC_MSG_CHECKING([for cfitsio (without pkg-config)]) + TMPCPPFLAGS=$CPPFLAGS + CPPFLAGS="$TMPCPPFLAGS $cfitsio_headers" + TMPLDFLAGS=$LDFLAGS + LDFLAGS="$TMPLDFLAGS $cfitsio_lib" + TMPLIBS=$LIBS + LIBS=-lcfitsio + AC_TRY_LINK( + [#include + #include ], + [fitsfile* fptr=NULL; std::string file=""; int status=0; + fits_open_file(&fptr, file.c_str(), 0, &status);], + [have_cfitsio=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + CPPFLAGS=$TMPCPPFLAGS + LDFLAGS=$TMPLDFLAGS + LIBS=$TMPLIBS + CFITSIOLDFLAGS="$cfitsio_lib -lcfitsio" + CFITSIOCPPFLAGS="$cfitsio_headers" + pkg_cflags="${pkg_cflags} ${CFITSIOCPPFLAGS}" + pkg_libs="${pkg_libs} ${CFITSIOLDFLAGS}" + ] + ) + ], + [] +) +AS_IF([test "x$have_cfitsio" == "xno"], + [AS_IF([test "x$with_cfitsio" == "xyes"], + [AC_MSG_ERROR([cfitsio requested but not found]) + ] + ) + ], + [use_cfitsio=yes + AC_DEFINE([GYOTO_USE_CFITSIO], + [1], + [Define to 1 if you have cfitsio]) + ] +) +AM_CONDITIONAL([HAVE_CFITSIO], [test "x$have_cfitsio" == "xyes"]) +AC_SUBST([CFITSIOLDFLAGS]) +AC_SUBST([CFITSIOCPPFLAGS]) + +# Check for LORENE +AC_MSG_CHECKING([for LORENE]) +AC_ARG_VAR([MAKE_S], + [make command which does not print directories [[make -w]]]) +AS_IF([test "x$MAKE_S" = "x"], + [MAKE_S="make -s"]) +AC_ARG_VAR([HOME_LORENE], + [path to Lorene build directory (see also --with-lorene)]) +# first check whether LORENE is required and get HOME_LORENE +require_lorene=no +AC_ARG_WITH([lorene], + [AS_HELP_STRING([--with-lorene[[=${HOME_LORENE}]]], + [force using the optional LORENE library, possibly specifying HOME_LORENE + [default=${HOME_LORENE}]])], + [AS_IF([test "x$with_lorene" == "xno"], + [HOME_LORENE="" + AC_MSG_RESULT([no]) + ], + [test "x$with_lorene" == "xyes"], + [require_lorene=yes + AS_IF([test "x$HOME_LORENE" != "x"], + [AC_MSG_RESULT($HOME_LORENE)], + [AC_MSG_ERROR([--with-lorene passed with no path: please specify LORENE + path either using the HOME_LORENE environment variable + or --with-lorene=.])]) + ], + [require_lorene=yes + HOME_LORENE="$with_lorene" + AC_MSG_RESULT($HOME_LORENE) + ]) + ], + [AS_IF([test "x$HOME_LORENE" != "x"], + [AC_MSG_RESULT($HOME_LORENE)], + [AC_MSG_RESULT([no])]) + ] +) +# then check whether LORENE is actually installed in HOME_LORENE +# finally output HOME_LORENE +AC_SUBST([HOME_LORENE]) +AM_CONDITIONAL([HAVE_LORENE], [test "x$HOME_LORENE" != "x"]) +AS_IF([test "x$HOME_LORENE" != "x"], + [ + AS_IF([test ! -r ${HOME_LORENE}/local_settings], + [AC_MSG_ERROR([${HOME_LORENE}/local_settings not found])]) +cat >conftest.make <<_ACEOF +include \$(HOME_LORENE)/local_settings +conftest.make: + touch conftest.make + +%: conftest.make + @echo \$(\$@) +_ACEOF + LORENELDFLAGS="-L$HOME_LORENE/Lib -llorene -llorenef77" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LAPACK | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_GSL | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_PGPLOT | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_LORENE | tr -d '\n\r'`" + LORENELDFLAGS="$LORENELDFLAGS `$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make LIB_CXX | tr -d '\n\r'`" + LORENECPPFLAGS=`$MAKE_S HOME_LORENE=$HOME_LORENE -f conftest.make INC | tr -d '\n\r'` + LORENECPPFLAGS="$LORENECPPFLAGS" + AC_DEFINE([GYOTO_USE_LORENE], + [1], + [Define to 1 if you have Lorene]) + rm conftest.make + AC_SUBST([LORENECPPFLAGS]) + AC_SUBST([LORENELDFLAGS]) + pkg_cflags="${pkg_cflags} ${LORENECPPFLAGS}" + pkg_libss="${pkg_libss} ${LORENELDFLAGS}" + + ] +) + +# disable doc +AC_ARG_ENABLE([doc], + [AS_HELP_STRING([--disable-doc], + [disable building documentation])], + [AS_IF([test "x$enable_doc" == "xyes"], + [mkdoc=yes], + [test "x$enable_doc" == "xno"], + [mkdoc=no], + [AC_MSG_ERROR([Please set --disable-doc or --enable-doc only to ``yes'' or ``no''])]) + ], + [mkdoc=yes]) + +# Finalization: select output files, subdirs etc. +AC_SUBST([pkg_requires]) +AC_SUBST([pkg_cflags]) +AC_SUBST([pkg_libs]) +mySUBDIRS="lib" +AS_IF([test "x$use_xerces" != "x" && test "x$use_cfitsio" != "x"], + [mySUBDIRS="$mySUBDIRS bin"]) +AC_CONFIG_FILES([Makefile + bin/Makefile + doc/Makefile + lib/Makefile + lib/gyoto.pc + lib/gyoto-uninstalled.pc + ]) +AS_IF([test "x$YORICK" != "x"], + [mySUBDIRS="$mySUBDIRS yorick" + AC_CONFIG_FILES([yorick/Makefile], + [oldpwd=`pwd` + cd yorick + $YORICK -batch make.i + cd $oldpwd], + YORICK=$YORICK) + AC_CONFIG_FILES([yorick/stdplug/Makefile], + [oldpwd=`pwd` + cd yorick/stdplug + $YORICK -batch make.i + cd $oldpwd], + YORICK=$YORICK) + AC_CONFIG_FILES([yorick/gyoto.info]) + ] +) +AS_IF([test "x$DOXYGEN" != "x" && test "x$mkdoc" == "xyes"], [mySUBDIRS="$mySUBDIRS doc"]) +AC_SUBST([mySUBDIRS]) +AC_OUTPUT +AS_IF([test "x$have_xerces" == "xno" || test "x$have_cfitsio" == "xno" ], + [ + AC_MSG_WARN( + [ + + Building without xerces-c and/or cfitsio. + + *** The gyoto executable will not be built! *** + + Gyoto can still be used as a C++ library and through the Yorick plug-in + (although without XML support and/or without certain object types). + ]) + ]) +AS_IF([test "x$have_udunits" == "xno"], + [ + AC_MSG_WARN( + [ + + Building without udunits + + *** Unit conversions disabled *** + + ]) + ]) diff -Nru gyoto-0.0.3/debian/changelog gyoto-0.1.0/debian/changelog --- gyoto-0.0.3/debian/changelog 2012-10-10 16:25:57.000000000 +0000 +++ gyoto-0.1.0/debian/changelog 2013-08-03 20:59:39.000000000 +0000 @@ -1,16 +1,16 @@ -gyoto (0.0.3-5ubuntu2) quantal; urgency=low +gyoto (0.1.0-2) unstable; urgency=low - * Really fix build failure with --no-copy-dt-needed-entries. + * Bug fix: "fails to upgrade from 'testing' - trying to + overwrite /usr/include/Gyoto/Gyoto.h", thanks to Andreas Beckmann + (Closes: #718629). - -- Matthias Klose Wed, 10 Oct 2012 18:25:01 +0200 + -- Thibaut Paumard Sat, 03 Aug 2013 22:59:39 +0200 -gyoto (0.0.3-5ubuntu1) quantal; urgency=low +gyoto (0.1.0-1) unstable; urgency=low - * Merge from Debian testing. Remaining changes: - - debian/patches/fix-ftbfs-with-binutils-gold (Closes: #682956): - + Reorder libs to fix FTBFS with binutils-gold. + * New upstream release - -- Angel Abad Fri, 03 Aug 2012 11:59:10 +0000 + -- Thibaut Paumard Sat, 27 Jul 2013 11:35:04 +0200 gyoto (0.0.3-5) unstable; urgency=low @@ -51,13 +51,6 @@ -- Thibaut Paumard Tue, 10 Jul 2012 10:50:50 +0200 -gyoto (0.0.3-1ubuntu1) quantal; urgency=low - - * debian/patches/fix-ftbfs-with-binutils-gold (Closes: #682956): - - Reorder libs to fix FTBFS with binutils-gold. - - -- Angel Abad Fri, 27 Jul 2012 12:36:53 +0200 - gyoto (0.0.3-1) unstable; urgency=low * Initial release (Closes: #640809) diff -Nru gyoto-0.0.3/debian/control gyoto-0.1.0/debian/control --- gyoto-0.0.3/debian/control 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/control 2013-08-03 21:00:55.000000000 +0000 @@ -1,13 +1,12 @@ Source: gyoto Section: science Priority: extra -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Science Maintainers -Uploaders: Thibaut Paumard -Build-Depends: debhelper (>= 7.0.50~), yorick-dev, yorick-yutils, doxygen, - libxerces-c-dev, libcfitsio3-dev -Standards-Version: 3.9.3 -DM-Upload-Allowed: yes +Maintainer: Debian Science Maintainers +Uploaders: Thibaut Paumard +Build-Depends: debhelper (>= 7.0.50~), yorick-dev, yorick-yutils, + libxerces-c-dev, libcfitsio3-dev, libudunits2-dev +Build-Depends-Indep: doxygen, doxygen-latex +Standards-Version: 3.9.4 Vcs-Git: git://git.debian.org/git/debian-science/packages/gyoto.git Vcs-Browser: http://git.debian.org/?p=debian-science/packages/gyoto.git Homepage: http://gyoto.obspm.fr @@ -26,9 +25,9 @@ . More complex uses of the Gyoto framework can be achieved using the yorick-gyoto package. Gyoto can be extended with plug-ins (see - libgyoto0-dev). + libgyoto1-dev). -Package: libgyoto0 +Package: libgyoto1 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: General relativistic geodesic integration and ray-tracing @@ -36,29 +35,31 @@ ray-traced images in General relativity. It consists in a shared library (this package), utility programs (in the gyoto package), and a plug-in for the Yorick programing language (in yorick-gyoto). Gyoto - can be extended with plug-ins (see libgyoto0-dev). + can be extended with plug-ins (see libgyoto1-dev). Package: gyoto-dbg Architecture: any Section: debug -Depends: libgyoto0 (= ${binary:Version}), +Depends: libgyoto1 (= ${binary:Version}), gyoto (= ${binary:Version}) [!kfreebsd-any], yorick-gyoto (= ${binary:Version}), ${misc:Depends} -Description: debugging symbols for gyoto, libgyoto0 and yorick-gyoto +Description: debugging symbols for gyoto, libgyoto1 and yorick-gyoto Gyoto aims at providing a framework for computing orbits and ray-traced images in General relativity. It consists in a shared library (this package), utility programs (in the gyoto package), and a plug-in for the Yorick programing language (in yorick-gyoto). . - This package contains the debugging symbols for the gyoto, libgyoto0 + This package contains the debugging symbols for the gyoto, libgyoto1 and yorick-gyoto packages. -Package: libgyoto0-dev +Package: libgyoto1-dev Architecture: any Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libgyoto0 (= ${binary:Version}), +Depends: ${shlibs:Depends}, ${misc:Depends}, libgyoto1 (= ${binary:Version}), libc-dev, libxerces-c3.1 +Replaces: libgyoto0-dev +Breaks: libgyoto0-dev Description: development files for libgyoto Gyoto aims at providing a framework for computing orbits and ray-traced images in General relativity. @@ -68,8 +69,8 @@ Package: yorick-gyoto Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, python-glade2, python, - yorick (>= 2.1.05), yorick-yutils (>= 1.3) +Depends: ${shlibs:Depends}, ${misc:Depends}, + yorick (>= 2.1.05), yorick-yutils (>= 1.3), yorick-gy, gir1.2-gtk-3.0 Description: General relativistic geodesic integration for the Yorick language Gyoto aims at providing a framework for computing orbits and ray-traced images in General relativity. diff -Nru gyoto-0.0.3/debian/copyright gyoto-0.1.0/debian/copyright --- gyoto-0.0.3/debian/copyright 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/copyright 2013-08-03 20:58:13.000000000 +0000 @@ -3,8 +3,8 @@ Source: https://github.com/gyoto/Gyoto Files: * -Copyright: 2011-2012 Thibaut Paumard -- thibaut.paumard at obspm.fr - 2011-2012 Frédéric Vincent -- frederic.vincent at obspm.fr +Copyright: 2011-2013 Thibaut Paumard -- thibaut.paumard at obspm.fr + 2011-2013 Frédéric Vincent -- frederic.vincent at obspm.fr License: GPL-3.0+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru gyoto-0.0.3/debian/gyotoy.desktop gyoto-0.1.0/debian/gyotoy.desktop --- gyoto-0.0.3/debian/gyotoy.desktop 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/gyotoy.desktop 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1,8 @@ +[Desktop Entry] +Categories=Education;Science;Astronomy;GTK; +Type=Application +Exec=gyotoy %F +Icon=gyotoy +Name=Gyotoy +GenericName=General Relativity Orbit Tracer +Terminal=false diff -Nru gyoto-0.0.3/debian/libgyoto0-dev.install gyoto-0.1.0/debian/libgyoto0-dev.install --- gyoto-0.0.3/debian/libgyoto0-dev.install 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto0-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/include -usr/lib/*.a \ No newline at end of file diff -Nru gyoto-0.0.3/debian/libgyoto0-dev.links gyoto-0.1.0/debian/libgyoto0-dev.links --- gyoto-0.0.3/debian/libgyoto0-dev.links 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto0-dev.links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/libgyoto.so.0 usr/lib/libgyoto.so diff -Nru gyoto-0.0.3/debian/libgyoto0.install gyoto-0.1.0/debian/libgyoto0.install --- gyoto-0.0.3/debian/libgyoto0.install 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto0.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/lib/libgyoto.so.?.?.? -usr/lib/gyoto -debian/lintian-overrides.d/libgyoto0 usr/share/lintian/overrides diff -Nru gyoto-0.0.3/debian/libgyoto0.links gyoto-0.1.0/debian/libgyoto0.links --- gyoto-0.0.3/debian/libgyoto0.links 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto0.links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/libgyoto.so.0.0.0 usr/lib/libgyoto.so.0 diff -Nru gyoto-0.0.3/debian/libgyoto1-dev.install gyoto-0.1.0/debian/libgyoto1-dev.install --- gyoto-0.0.3/debian/libgyoto1-dev.install 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto1-dev.install 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1,3 @@ +usr/include +usr/lib/*.a +usr/lib/gyoto/*/*.a diff -Nru gyoto-0.0.3/debian/libgyoto1-dev.links gyoto-0.1.0/debian/libgyoto1-dev.links --- gyoto-0.0.3/debian/libgyoto1-dev.links 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto1-dev.links 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/libgyoto.so.1 usr/lib/libgyoto.so diff -Nru gyoto-0.0.3/debian/libgyoto1.install gyoto-0.1.0/debian/libgyoto1.install --- gyoto-0.0.3/debian/libgyoto1.install 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto1.install 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1,3 @@ +usr/lib/libgyoto.so.?.?.? +usr/lib/gyoto/*/libgyoto*.so* +debian/lintian-overrides.d/libgyoto? usr/share/lintian/overrides diff -Nru gyoto-0.0.3/debian/libgyoto1.links gyoto-0.1.0/debian/libgyoto1.links --- gyoto-0.0.3/debian/libgyoto1.links 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/libgyoto1.links 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/libgyoto.so.1.0.0 usr/lib/libgyoto.so.1 diff -Nru gyoto-0.0.3/debian/lintian-overrides.d/libgyoto0 gyoto-0.1.0/debian/lintian-overrides.d/libgyoto0 --- gyoto-0.0.3/debian/lintian-overrides.d/libgyoto0 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/lintian-overrides.d/libgyoto0 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# Maintaining a symbols file would be unsustainable. See e.g.: -# http://www.eyrie.org/~eagle/journal/2012-02/001.html -libgyoto0: no-symbols-control-file usr/lib/libgyoto.so.0.0.0 - -# The fortifiable functions are all in the main library libgyoto.so. -libgyoto0: hardening-no-fortify-functions usr/lib/gyoto/0.0.0/libgyoto-stdplug.so diff -Nru gyoto-0.0.3/debian/lintian-overrides.d/libgyoto1 gyoto-0.1.0/debian/lintian-overrides.d/libgyoto1 --- gyoto-0.0.3/debian/lintian-overrides.d/libgyoto1 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/lintian-overrides.d/libgyoto1 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1,6 @@ +# Maintaining a symbols file would be unsustainable. See e.g.: +# http://www.eyrie.org/~eagle/journal/2012-02/001.html +libgyoto1: no-symbols-control-file usr/lib/libgyoto.so.1.0.0 + +# The fortifiable functions are all in the main library libgyoto.so. +libgyoto1: hardening-no-fortify-functions usr/lib/gyoto/1.0.0/libgyoto-stdplug.so.0.0.0 diff -Nru gyoto-0.0.3/debian/patches/buffer-overflow gyoto-0.1.0/debian/patches/buffer-overflow --- gyoto-0.0.3/debian/patches/buffer-overflow 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/buffer-overflow 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Subject: rm bin/gyoto.o on cleanfix buffer overflow in Factory.C -Author: Thibaut Paumard -Origin: vendor -Date: 2012-06-22 -Forwarded: yes (I will include it in the next release.) - ---- a/lib/Factory.C -+++ b/lib/Factory.C -@@ -41,8 +41,8 @@ - using namespace xercesc; - using namespace std; - --#define dvalLength 21 --#define dfmt " %20.16g " -+#define dvalLength 25 -+#define dfmt " %.16g " - #define d2txt(txt, val) sprintf( txt , dfmt, val) - #define ifmt " %li " - #define i2txt(txt, val) sprintf( txt, ifmt, val); diff -Nru gyoto-0.0.3/debian/patches/check-locale gyoto-0.1.0/debian/patches/check-locale --- gyoto-0.0.3/debian/patches/check-locale 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/patches/check-locale 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1,28 @@ +Description: Make sure checks are done with UTF8 locale +Author: Thibaut Paumard +Origin: vendor +Forwarded: no +Last-Update: 2013-07-28 + +--- a/bin/Makefile.am ++++ b/bin/Makefile.am +@@ -11,7 +11,7 @@ + gyoto_CPPFLAGS = $(AM_CPPFLAGS) $(CFITSIOCPPFLAGS) + gyoto_LDFLAGS = $(AM_LDFLAGS) $(CFITSIOLDFLAGS) -export-dynamic + +-CHECK_CMD = unset GYOTO_PLUGINS && ./gyoto ++CHECK_CMD = unset GYOTO_PLUGINS && LANG=C.UTF-8 ./gyoto + check: gyoto + $(CHECK_CMD) ../doc/examples/example-thin-disk.xml \ + \!example-thin-disk.fits +--- a/bin/Makefile.in ++++ b/bin/Makefile.in +@@ -301,7 +301,7 @@ + gyoto_LDADD = @top_builddir@/lib/libgyoto.la + gyoto_CPPFLAGS = $(AM_CPPFLAGS) $(CFITSIOCPPFLAGS) + gyoto_LDFLAGS = $(AM_LDFLAGS) $(CFITSIOLDFLAGS) -export-dynamic +-CHECK_CMD = unset GYOTO_PLUGINS && ./gyoto ++CHECK_CMD = unset GYOTO_PLUGINS && LANG=C.UTF-8 ./gyoto + all: all-am + + .SUFFIXES: diff -Nru gyoto-0.0.3/debian/patches/clean-gyoto gyoto-0.1.0/debian/patches/clean-gyoto --- gyoto-0.0.3/debian/patches/clean-gyoto 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/clean-gyoto 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Subject: rm bin/gyoto.o on clean -Author: Thibaut Paumard -Origin: vendor -Date: 2012-05-09 -Forwarded: yes (I will include it in the next release.) - ---- a/bin/Makefile -+++ b/bin/Makefile -@@ -4,9 +4,8 @@ - - .SUFFIXES : .o .C - --#SRC = code.C RayTracingSch.C RayTracingSch_Disk.C #truc.C --#SRC = Orbite.C RayTracing.C --#OBJ = $(SRC:.C=.o) -+SRC = gyoto.C -+OBJ = $(SRC:.C=.o) - - LIB_SRC = $(shell ls ../lib/*.C) - HDRS = $(shell ls ../include/*.h) diff -Nru gyoto-0.0.3/debian/patches/configuration gyoto-0.1.0/debian/patches/configuration --- gyoto-0.0.3/debian/patches/configuration 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/configuration 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -Description: Configuration - Fill local_settings for a Debian system -Author: Thibaut Paumard -Origin: vendor -Forwarded: not-needed -Last-Update: 2012-05-09 - ---- a/local_settings -+++ b/local_settings -@@ -2,7 +2,7 @@ - # ------------ - # Header wil go to $(PREFIX)/include, libraries to $(PREFIX)/lib, - # binaries to $(PREFIX)/tools. --PREFIX = /usr/local -+PREFIX = /usr - - # C++ compiler: - # ------------ -@@ -28,9 +28,9 @@ - # Comment next line to disable Xerces: - GYOTO_FLAGS += -DGYOTO_USE_XERCES - # Where are Xerces include files: --XERCES_INC = -I/opt/local/include -+XERCES_INC = - # Where is libxercesc.so/.dylib/.a: --XERCES_LDFLAGS = -L/opt/local/lib -+XERCES_LDFLAGS = -lxerces-c - - # Options for using cfisio: - # ------------------------- -@@ -38,8 +38,8 @@ - # It is required for building the gyoto executable. - # Parts of the library will not be built if GYOTO_USE_CFITSIO is not set. - GYOTO_FLAGS += -DGYOTO_USE_CFITSIO --CFITSIO_INC = -I/opt/local/include --CFITSIO_PATH = -L/opt/local/lib -+CFITSIO_INC = -+CFITSIO_PATH = - - # ________________________________________________________________ - # It shouldn't be necessary to change anything below this line -@@ -47,10 +47,12 @@ - - # Options for the C++ compiler - # ---------------------------- -+ifndef CXXFLAGS - CXXFLAGS = -g -pedantic -Wall -W -Wundef -Wshadow -Wcast-qual \ - -Wcast-align -Wconversion -Winline \ -- -Wabi -Woverloaded-virtual -Wno-long-long -fPIC -- -+ -Wabi -Woverloaded-virtual -Wno-long-long -+endif -+CXXFLAGS += -fPIC - - # Path for the include files - # -------------------------------------------- -@@ -93,6 +95,6 @@ - GYOTO_FLAGS += -DGYOTO_PREFIX=\"$(PREFIX)\" - GYOTO_FLAGS += -DGYOTO_SOVERS=\"$(SOVERS)\" - --CPPFLAGS = $(CFITSIO_INC) $(XERCES_INC) --LDFLAGS = $(GYOTO_LDFLAGS) -+CPPFLAGS += $(CFITSIO_INC) $(XERCES_INC) -+LDFLAGS += $(GYOTO_LDFLAGS) - LDLIBS = $(LIB_CXX) diff -Nru gyoto-0.0.3/debian/patches/fix-ftbfs-with-binutils-gold gyoto-0.1.0/debian/patches/fix-ftbfs-with-binutils-gold --- gyoto-0.0.3/debian/patches/fix-ftbfs-with-binutils-gold 2012-10-10 16:26:08.000000000 +0000 +++ gyoto-0.1.0/debian/patches/fix-ftbfs-with-binutils-gold 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Description: Reorder libs to fix FTBFS with binutils-gold -Author: Angel Abad - -Index: gyoto-0.0.3/bin/Makefile -=================================================================== ---- gyoto-0.0.3.orig/bin/Makefile 2012-10-10 16:22:07.000000000 +0000 -+++ gyoto-0.0.3/bin/Makefile 2012-10-10 16:22:07.000000000 +0000 -@@ -27,7 +27,7 @@ - $(CXX) -o $@ $(CXXFLAGS) $(GYOTO_INC) $^ $(LIB_CXX_Gyoto) - - gyoto: gyoto.o ../lib/$(LIBGYOTO_FILE) -- $(CXX) -o $@ $(LDFLAGS) $(LDLIBS) $< -L../lib -lgyoto -ldl -+ $(CXX) -o $@ -L../lib $(LDFLAGS) $< $(LDLIBS) -lgyoto -ldl - - dbgyoto: debugyoto.C ../lib/libgyoto.a - $(CXX) -o $@ $(CXXFLAGS) $(GYOTO_INC) $^ $(LIB_CXX_Gyoto) $(LIB_CXX) $(LIB_CFITSIO) $(LIB_LORENE) $(LIB_LAPACK) $(LIB_GSL) $(LIB_PGPLOT) -Wno-long-long -Index: gyoto-0.0.3/lib/Makefile -=================================================================== ---- gyoto-0.0.3.orig/lib/Makefile 2012-05-01 11:41:58.000000000 +0000 -+++ gyoto-0.0.3/lib/Makefile 2012-10-10 16:24:59.572716466 +0000 -@@ -51,7 +51,7 @@ - ln -fs $(LIBGYOTO_FILE) libgyoto.so.$(SOVERS_MAJOR) - ln -fs $(LIBGYOTO_FILE) libgyoto.so - endif -- $(CXX) -o $(LIBGYOTO_FILE) $(DYLIB_FLAG) $(LDFLAGS) $(LDLIBS) $^ -+ $(CXX) -o $(LIBGYOTO_FILE) $(DYLIB_FLAG) $^ $(LDFLAGS) $(LDLIBS) - - libgyoto-stdplug.$(DYLIB_SFX): $(STDPLUG_OBJ) StdPlug.o $(LIBGYOTO_FILE) Metric.o - $(CXX) -o $@ $(PLUG_FLAGS) $(STDPLUG_OBJ) StdPlug.o $(LDFLAGS) $(LDLIBS) diff -Nru gyoto-0.0.3/debian/patches/getpid_includes gyoto-0.1.0/debian/patches/getpid_includes --- gyoto-0.0.3/debian/patches/getpid_includes 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/getpid_includes 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Subject: add headers for getpid() to gyoto.C -Author: Thibaut Paumard -Origin: vendor -Date: 2012-05-09 -Forwarded: yes (I will include it in the next release.) - ---- a/bin/gyoto.C -+++ b/bin/gyoto.C -@@ -23,6 +23,8 @@ - #include "GyotoDefs.h" - #include - #include -+#include -+#include - - using namespace std; - using namespace Gyoto; diff -Nru gyoto-0.0.3/debian/patches/interpreter-path gyoto-0.1.0/debian/patches/interpreter-path --- gyoto-0.0.3/debian/patches/interpreter-path 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/interpreter-path 2013-08-03 20:58:13.000000000 +0000 @@ -7,8 +7,8 @@ --- a/yorick/gyotoy.i +++ b/yorick/gyotoy.i @@ -1,4 +1,4 @@ --#!/usr/local/bin/yorick -i +-#!/usr/bin/env yorick -i +#!/usr/bin/yorick -i /* Copyright 2007 F. Rigaut - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard diff -Nru gyoto-0.0.3/debian/patches/no-utf8 gyoto-0.1.0/debian/patches/no-utf8 --- gyoto-0.0.3/debian/patches/no-utf8 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/debian/patches/no-utf8 2013-08-03 20:58:13.000000000 +0000 @@ -0,0 +1,68 @@ +Description: Remove UTF strings from units in example files +Author: Thibaut Paumard +Origin: vendor +Forwarded: not-needed +Last-Update: 2013-07-28 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/doc/examples/example-fixed-star.xml ++++ b/doc/examples/example-fixed-star.xml +@@ -9,8 +9,8 @@ + + 8 + +- 150 +- 90 ++ 150 ++ 90 + 0 + 0 + 32 +--- a/doc/examples/example-polish-doughnut.xml ++++ b/doc/examples/example-polish-doughnut.xml +@@ -13,22 +13,22 @@ + "dmax" is a tuning parameter and is always expressed in + geometrical units. + +- 150 ++ 150 + A reasonable field-of-view, about 15 Schwarzschild radii. +- 90 ++ 90 + 90° is edge-on +- 180 ++ 180 + Put top on top... + 0 + 32 + +- ++ + 0.9 1.1 + +- ++ + 2.1 2.3 + +- ++ + 2.9 3.1 + + +@@ -36,14 +36,14 @@ + + + This is what a real-life detector measures. +- Spectrum[mJy/pix²] ++ Spectrum[mJy/pix^2] + This unit can easily be confronted to observations. + + + We can specify the plug-in in which this Astrobj is implemented. + 0.3 + 0.1 +- 1e-17 ++ 1e-17 + g/cm³ is actually the same as kg/L, the default. + 0.02 + 0.1 diff -Nru gyoto-0.0.3/debian/patches/paper-ref gyoto-0.1.0/debian/patches/paper-ref --- gyoto-0.0.3/debian/patches/paper-ref 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/paper-ref 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Subject: update biblographic reference in gyoto.C according to README -Author: Thibaut Paumard -Origin: vendor -Date: 2012-06-22 -Forwarded: yes (I will include it in the next release.) - ---- a/bin/gyoto.C -+++ b/bin/gyoto.C -@@ -163,7 +163,8 @@ - << " properly \n acknowledged. Please cite:\n" - << " GYOTO: a new general relativistic ray-tracing code,\n" - << " F. H. Vincent, T. Paumard, E. Gourgoulhon & G. Perrin 2011,\n" -- << " Classical and Quantum Gravity, accepted. [arXiv:1109.4769]" -+ << " Classical and Quantum Gravity 28, 225011 (2011) " -+ << "[arXiv:1109.4769]" - << endl << endl; - - // set-up error reporter diff -Nru gyoto-0.0.3/debian/patches/series gyoto-0.1.0/debian/patches/series --- gyoto-0.0.3/debian/patches/series 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/patches/series 2013-08-03 20:58:13.000000000 +0000 @@ -1,7 +1,2 @@ -configuration -getpid_includes -clean-gyoto -buffer-overflow interpreter-path -paper-ref -fix-ftbfs-with-binutils-gold +no-utf8 diff -Nru gyoto-0.0.3/debian/rules gyoto-0.1.0/debian/rules --- gyoto-0.0.3/debian/rules 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/rules 2013-08-03 20:58:13.000000000 +0000 @@ -14,6 +14,9 @@ # Don't accidentally build the lorene plug-in unexport HOME_LORENE +configure_flags = --with-yorick=/usr/bin/yorick --with-udunits --with-xerces \ + --without-lorene --prefix=/usr --enable-static --enable-shared + install-arch: build-stamp dh_auto_install dh_install -a -N yorick-gyoto @@ -43,6 +46,7 @@ build-stamp: dh_testdir -a + ./configure $(configure_flags) --disable-doc make COPT_DEFAULT="" \ Y_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \ Y_LDFLAGS="$(LDFLAGS)" @@ -50,13 +54,14 @@ ifeq (,$(filter $(DEB_HOST_ARCH), kfreebsd-i386 kfreebsd-amd64 mips)) # skip the test suite on kfreebsd-any as gyoto package not beeing built # skip on mips as lucatelli2 fails on it (but the binary works on other boxes) - make check + LANG=C.UTF-8 make check endif endif touch build-stamp doc-stamp: dh_testdir -i + ./configure $(configure_flags) --enable-doc make doc touch doc-stamp @@ -68,8 +73,13 @@ binary-arch: install-arch dh $@ -clean: +configure-stamp: + ./configure --without-lorene --prefix=/usr + touch configure-stamp + +clean: configure-stamp dh_testdir + ./configure $(configure_flags) --enable-doc make distclean dh_clean doc-stamp build-stamp @@ -88,4 +98,4 @@ -rm .pc/.version .pc/.quilt_series .pc/.quilt_patches if test -e .pc; then rmdir .pc; fi -.PHONY: clean git-clean override_dh_strip override_dh_auto_test \ No newline at end of file +.PHONY: clean git-clean override_dh_strip override_dh_auto_test diff -Nru gyoto-0.0.3/debian/watch gyoto-0.1.0/debian/watch --- gyoto-0.0.3/debian/watch 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/watch 2013-08-03 20:58:13.000000000 +0000 @@ -1,2 +1,3 @@ version=3 -https://github.com/gyoto/Gyoto/tags .*/tarball/(\d[\d\.]+) +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/Gyoto-$1.tar.gz/ \ + https://github.com/gyoto/Gyoto/tags .*/archive/v?(\d\S*)\.tar\.gz diff -Nru gyoto-0.0.3/debian/yorick-gyoto.ynstall gyoto-0.1.0/debian/yorick-gyoto.ynstall --- gyoto-0.0.3/debian/yorick-gyoto.ynstall 2012-08-03 11:59:09.000000000 +0000 +++ gyoto-0.1.0/debian/yorick-gyoto.ynstall 2013-08-03 20:58:13.000000000 +0000 @@ -1,11 +1,12 @@ -debian/tmp/usr/lib/yorick/glade/gyotoy.glade +debian/tmp/usr/lib/yorick/glade/gyotoy.xml glade +debian/tmp/usr/lib/yorick/data/gyotoy.png data usr/share/pixmaps/gyotoy.png +debian/gyotoy.desktop usr/share/applications debian/tmp/usr/lib/yorick/i/gyotoy.i i usr/bin/gyotoy debian/tmp/usr/lib/yorick/i/*.i debian/tmp/usr/lib/yorick/i0/*.i i0 debian/tmp/usr/lib/yorick/include/ygyoto.h include debian/tmp/usr/lib/yorick/include/ygyoto_supplier.C include debian/tmp/usr/lib/yorick/lib/*.so -debian/tmp/usr/lib/yorick/python/gyotoy.py debian/lintian-overrides.d/yorick-gyoto usr/share/lintian/overrides yorick/yorick-gyoto.aliases yorick/yorick-gyoto.packinfo diff -Nru gyoto-0.0.3/depcomp gyoto-0.1.0/depcomp --- gyoto-0.0.3/depcomp 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/depcomp 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,708 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2012-03-27.16; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependent.h'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\': + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' "$nl" < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru gyoto-0.0.3/doc/Makefile gyoto-0.1.0/doc/Makefile --- gyoto-0.0.3/doc/Makefile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -SHELL=/bin/sh - -doc: ../include/*.h - doxygen doxyfile - -clean: - rm -fr html latex - rm -fr *~ diff -Nru gyoto-0.0.3/doc/Makefile.in gyoto-0.1.0/doc/Makefile.in --- gyoto-0.0.3/doc/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/doc/Makefile.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,12 @@ +SHELL=/bin/sh + +all: doc + +doc: ../include/*.h + doxygen doxyfile + +distclean clean: + rm -fr html latex + rm -fr *~ + +%: ; diff -Nru gyoto-0.0.3/doc/Makefile.old gyoto-0.1.0/doc/Makefile.old --- gyoto-0.0.3/doc/Makefile.old 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/doc/Makefile.old 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,8 @@ +SHELL=/bin/sh + +doc: ../include/*.h + doxygen doxyfile + +clean: + rm -fr html latex + rm -fr *~ diff -Nru gyoto-0.0.3/doc/doxyfile gyoto-0.1.0/doc/doxyfile --- gyoto-0.0.3/doc/doxyfile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/doxyfile 2013-07-27 09:14:20.000000000 +0000 @@ -1244,7 +1244,7 @@ # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = GYOTO_USE_XERCES +PREDEFINED = DOXYGEN_RUN GYOTO_USE_XERCES # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff -Nru gyoto-0.0.3/doc/examples/example-complex-astrobj.xml gyoto-0.1.0/doc/examples/example-complex-astrobj.xml --- gyoto-0.0.3/doc/examples/example-complex-astrobj.xml 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/examples/example-complex-astrobj.xml 2013-07-27 09:14:20.000000000 +0000 @@ -1,20 +1,19 @@ - + 0. 1000. 100. 1.22 0. - + 0.314159265358979323846264338327950288419716 32 2.0e-6 2.4e-6 - 2. 0. 0. 0.037037 @@ -102,5 +101,6 @@ Spectrum + 0. diff -Nru gyoto-0.0.3/doc/examples/example-fixed-star.xml gyoto-0.1.0/doc/examples/example-fixed-star.xml --- gyoto-0.0.3/doc/examples/example-fixed-star.xml 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/examples/example-fixed-star.xml 2013-07-27 09:14:20.000000000 +0000 @@ -8,9 +8,9 @@ 8 - - 150 - 90 + + 150 + 90 0 0 32 @@ -20,7 +20,6 @@ 12 0 0 0 - 10000. 0 0.001 @@ -33,5 +32,16 @@ 1e0 + 0. + + Intensity + + One can also specify a unit (if Gyoto was compiled with --with-udunits): + Intensity[mJy/pix²] + Intensity[mJy/µas²] + Intensity[J.m-2.s-1.sr-1.Hz-1] + Intensity[erg.cm-2.s-1.sr-1.Hz-1] + Intensity[mJy.sr-1] + Intensity[Jy.sr-1] diff -Nru gyoto-0.0.3/doc/examples/example-fixedstar-rotstar3_1.xml gyoto-0.1.0/doc/examples/example-fixedstar-rotstar3_1.xml --- gyoto-0.0.3/doc/examples/example-fixedstar-rotstar3_1.xml 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/examples/example-fixedstar-rotstar3_1.xml 2013-07-27 09:14:20.000000000 +0000 @@ -14,7 +14,7 @@ 1.57 0. - - + + + + -1000. + + Bolometric emission, this is the default (and only intensity) for + PageThorneDisk. diff -Nru gyoto-0.0.3/doc/examples/example-polish-doughnut.xml gyoto-0.1.0/doc/examples/example-polish-doughnut.xml --- gyoto-0.0.3/doc/examples/example-polish-doughnut.xml 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/doc/examples/example-polish-doughnut.xml 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,75 @@ + + + + + 4.31e6 + This is the mass of SgrA*, in solar mass. + 0. + + + + 8 + The distance to SgrA*. + "dmax" is a tuning parameter and is always expressed in + geometrical units. + + 150 + A reasonable field-of-view, about 15 Schwarzschild radii. + 90 + 90° is edge-on + 180 + Put top on top... + 0 + 32 + + + 0.9 1.1 + + + 2.1 2.3 + + + 2.9 3.1 + + + + + + This is what a real-life detector measures. + Spectrum[mJy/pix²] + This unit can easily be confronted to observations. + + + We can specify the plug-in in which this Astrobj is implemented. + 0.3 + 0.1 + 1e-17 + g/cm³ is actually the same as kg/L, the default. + 0.02 + 0.1 + + 25. + + Set UseSpecificImpact to use the specific implementation of + the Impact() method instead of Standard::Impact(). + 0. + Increase SafetyValue if you have trouble resolving the + surface of the doughnut. Increasing SafetyValue also + increases computation time. The default value is slightly + more conservative. + + Number of subsamples to use when computing BinSpectrum. + More subsamples is more accurate but slower. + + + Those two are numerical tuning parameters: + 1e0 + Default (initial) step for geodesic integration + 0. + No light-ray will be integrated further in the past. + + Do we want to use multi-threading? + 2 + + + diff -Nru gyoto-0.0.3/doc/examples/example-thin-disk.xml gyoto-0.1.0/doc/examples/example-thin-disk.xml --- gyoto-0.0.3/doc/examples/example-thin-disk.xml 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/examples/example-thin-disk.xml 2013-07-27 09:14:20.000000000 +0000 @@ -6,7 +6,7 @@ 1000. 100. 1.22 0. - + 0.314159265358979323846264338327950288419716 32 @@ -16,4 +16,5 @@ + 0. diff -Nru gyoto-0.0.3/doc/examples/example-torus.xml gyoto-0.1.0/doc/examples/example-torus.xml --- gyoto-0.0.3/doc/examples/example-torus.xml 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/doc/examples/example-torus.xml 2013-07-27 09:14:20.000000000 +0000 @@ -7,7 +7,7 @@ 1000. 100. 0.78 0. - + 0.15 32 2.0e-6 2.4e-6 @@ -25,6 +25,7 @@ 1e-10 + 20. BinSpectrum Binary files /tmp/ZU7Hh9jCzy/gyoto-0.0.3/doc/images/gyotoy_screenshot.png and /tmp/vmQvsUaul5/gyoto-0.1.0/doc/images/gyotoy_screenshot.png differ diff -Nru gyoto-0.0.3/include/Gyoto.h gyoto-0.1.0/include/Gyoto.h --- gyoto-0.0.3/include/Gyoto.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/Gyoto.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -21,7 +21,7 @@ * \file Gyoto.h * \brief All of Gyoto * - * Gyoto.h #includes all of the other Gyoto C++ header files. Beware + * Gyoto.h includes all of the other Gyoto C++ header files. Beware * that some symbols are resolved only in the plugins * (libgyoto-stdplug.so, libgyoto-lorene.so). */ @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -103,32 +102,19 @@ */ /** - * \page yorick_plugin_page Gyoto for Yorick - * - * \section yoprerec_sec Prerequisites - * - * \subsection yo_sec Yorick - * - * For direct access to Gyoto, only Yorick is required. Yorick comes - * precompiled with many distributions of Linux and is present in the - * Macports. You can also find binaries and source code at - * http://yorick.sourceforge.net/ - * - * One line in Yorick's yapi.h file used to make the compilation fail, so - * either use Yorick >= 2.1.06 or - * change this line: -\code -PLUG_API void *ygeta_any(int iarg, long *ntot, * long *dims, int *typeid); -\endcode -* to something like -\code -PLUG_API void *ygeta_any(int iarg, long *ntot, long *dims, int *typeidd) -\endcode - * - * For the graphical user interface Gyotoy, you'll need a few - * additional pieces. First of all, I seriously doubt it will run - * under MS Windows, but please report any news on that front. +\page yorick_plugin_page Gyoto for Yorick + +\section yoprerec_sec Prerequisites +\subsection yo_sec Yorick + +For direct access to Gyoto, only Yorick (>=2.2) is required. Yorick comes +precompiled with many distributions of Linux and is present in the +Macports. You can also find source code at https://github.com/dhmunro/yorick + +For the graphical user interface Gyotoy, you'll need a few additional +pieces. First of all, I seriously doubt it will run under MS Windows, +but please report any news on that front. \subsection yutils_sec Yutils @@ -141,12 +127,15 @@ http://yorick.cvs.sourceforge.net/viewvc/yorick/yorick-yutils/pyk.i?view=markup -\subsection pygtk_sec PyGTK - -The graphical interface is actually coded python using the pygtk -extension. So you'll need a recent version of python, PyGTK, and the -Glade library, on which PyGTK depends. +\subsection pygtk_sec PyGObject +The graphical interface gyotoy needs yorick-gy and the Gtk 3 GObject +Introspection files. Get yorick-gy from: +https://github.com/paumard/yorick-gy + +Under Mac OS X (using macports), install the gtk3 package. Under a +Debian derivative GNU/Linux system, install gir1.2-gtk-3.0. Check +yorick/README.gyotoy in the source distribution for more details. \section building_sec Building @@ -233,9 +222,9 @@ description. This is typically done by providing an static Init method in your class: \code -void Gyoto::FixedStar::Init() { - Gyoto::Astrobj::Register("FixedStar", &Gyoto::FixedStar::Subcontractor); -} + void Gyoto::FixedStar::Init() { + Gyoto::Astrobj::Register("FixedStar", &Gyoto::FixedStar::Subcontractor); + } \endcode You need to make sure this Init() method is called when your plug-in @@ -248,11 +237,11 @@ should also be fine). In addition to the implementation of the Gyoto::MyObj class, you will need to provide a function called __GyotoMyPlugInit() which will be exactly this: -\code -extern "C" void __GyotostdplugInit() { - Gyoto::MyObj::Init(); -} -\endcode + \code + extern "C" void __GyotostdplugInit() { + Gyoto::MyObj::Init(); + } + \endcode This function is typically provided in a separate source file (such as lib/StdPlug.C in the Gyoto source) and can initialize several custom classes at once. @@ -267,14 +256,14 @@ (if you don't know what this means or how to do this, ask the local Unix guru or read the fine manual): -\code -export GYOTO_PLUGINS="stdplug,nofail:lorene,MyPlug" -\endcode + \code + export GYOTO_PLUGINS="stdplug,nofail:lorene,MyPlug" + \endcode but if your lug-in is self-contained and your don't need the objects in the standard plug-ins, this will do it for you: -\code -export GYOTO_PLUGINS="MyPlug" -\endcode + \code + export GYOTO_PLUGINS="MyPlug" + \endcode This will instruct Gyoto to locate and load the file named libgyoto-MyPlug.(so|dylib) and to run the function named __GyotostdplugInit() from this library file. diff -Nru gyoto-0.0.3/include/GyotoAstrobj.h gyoto-0.1.0/include/GyotoAstrobj.h --- gyoto-0.0.3/include/GyotoAstrobj.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoAstrobj.h 2013-07-27 09:14:20.000000000 +0000 @@ -6,7 +6,7 @@ */ /* - Copyright 2011 Thibaut Paumard, Frederic Vincent + Copyright 2011-2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. @@ -28,6 +28,8 @@ #ifndef __GyotoAstrobj_H_ #define __GyotoAstrobj_H_ +#include "GyotoConfig.h" + #include #include #include @@ -35,6 +37,7 @@ #include #include +#include namespace Gyoto{ class Photon; @@ -59,8 +62,14 @@ ///< A function to build instances of a specific Astrobj::Generic sub-class /** - * Instead of reimplementing the wheel, your subcobtractor can simply be - * Gyoto::Astrobj::Subcontractor + * Instead of reimplementing the wheel, your subcontractor can simply be + * Gyoto::Astrobj::Subcontractor. + * + * If MyKind accepts any XML parameters, it should re-implement + * Astrobj::Generic::setParameter() or, if low-level access to the + * FactoryMessenger is needed, Generic::setParameters(). + * + * \tparam T Gyoto::Astrobj::Generic sub-class */ template SmartPointer Subcontractor (FactoryMessenger* fmp) { @@ -76,11 +85,15 @@ * called only from the Factory. * * \param name e.g. "Star" + * \param errmode 1 to return NULL in case of failure instead of + * throwing an Error. * \return pointer to the corresponding subcontractor. */ - Gyoto::Astrobj::Subcontractor_t* getSubcontractor(std::string name); + Gyoto::Astrobj::Subcontractor_t* getSubcontractor(std::string name, + int errmode = 1); ///< Query the Astrobj register +#if defined GYOTO_USE_XERCES /** * Use the Astrobj::initRegister() once in your program to * initiliaze it, the Astrobj::Register() function to fill it, and @@ -108,6 +121,7 @@ */ void Register(std::string name, Gyoto::Astrobj::Subcontractor_t* scp); ///< Make an Astrobj kind known to the Factory +#endif } } @@ -160,9 +174,9 @@ * . If your clas implements setParameter() and/or, if necessary, * setParameters(), registering it is normally done using the provided * template: -\code -Astrobj::Register("MyKind", &(Astrobj::Subcontractor)); -\endcode + * \code + * Astrobj::Register("MyKind", &(Astrobj::Subcontractor)); + * \endcode */ /** * \class Gyoto::Astrobj::Generic @@ -179,7 +193,7 @@ protected: /** - * The Metric in this end of the Universe + * \brief The Metric in this end of the Universe */ SmartPointer gg_; @@ -195,8 +209,9 @@ * constructor. In this case, getRmax() must always return this * value, not recompute it. * + * rmax_ is in geometrical units. */ - double rmax_; ///< Maximum distance to the center of the coordinate system. + double rmax_; ///< Maximum distance to the center of the coordinate system [geometrical units] /** * rmax_set_==1 means that rmax_ was set using setRmax() or the @@ -242,17 +257,20 @@ /** * This method must be implemented by the various Astrobj::Generic * subclasses in order to support cloning: -\code -SmartPointer deep_copy = original->clone(); -\endcode + * \code + * SmartPointer deep_copy = original->clone(); + * \endcode + * + * Cloning is necessary for multi-threading, recommended for + * interaction with the Yorick plug-in etc. * * Implementing it is very straightforward, as long as the copy * constructor Generic(const Generic& ) has been implemented: -\code -MyAstrobj* MyAstrobj::clone() const { return new MyAstrobj(*this); } -\endcode + * \code + * MyAstrobj* MyAstrobj::clone() const { return new MyAstrobj(*this); } + * \endcode */ - virtual Generic* clone() const = 0 ; ///< "Virtual" copy constructor + virtual Generic* clone() const = 0 ; ///< Cloner virtual ~Generic() ; ///< Destructor: does nothing. @@ -260,12 +278,12 @@ // --------- public: /** - * Get the Metric + * \brief Get the Metric Generic::gg_ */ virtual SmartPointer getMetric() const; /** - * Set the Metric + * \brief Set the Metric Generic::gg_ */ virtual void setMetric(SmartPointer) ; @@ -277,9 +295,19 @@ * * It can also be set using setRmax(). If setRmax has been used * to set rmax_, getRmax() must not recompute it. + * + * \return rmax_ in geometrical units */ virtual double getRmax(); ///< Get maximal distance from center of coordinate system + /** + * Call getRmax() and convert result to unit. + * + * \param unit string + * \return double rmax converted to unit + */ + virtual double getRmax(std::string unit); ///< Get rmax_ is specified unit + const std::string getKind() const; ///< Get the kind of the Astrobj (e.g. "Star") /** @@ -287,10 +315,20 @@ * Photon may hit the object. * * Side effect: set rmax_set_ to 1. + * \param val new rmax_ in geometrical units. */ virtual void setRmax(double val); ///< Set maximal distance from center of coordinate system /** + * Call Generic::setRmax(double val) after converting val from unit + * to geometrical units. + * + * \param val rmax_ expressed in unit "unit"; + * \param unit string... + */ + virtual void setRmax(double val, std::string unit); ///< Set maximal distance from center of coordinate system + + /** * getRmax() will then be free to recompute rmax_. Astrobjs * which cache rmax_ may need to update it when unsetRmax() is * called. @@ -317,20 +355,26 @@ * defaults GYOTO_QUANTITY_INTENSITY. */ virtual Quantity_t getDefaultQuantities(); + ///< Which quantities to compute if know was requested //XML I/O public: /** - * Assume MyKind is a sublcass of Astrobj::Generic which has towo + * \brief Set parameter by name + * + * Assume MyKind is a subclass of Astrobj::Generic which has two * members (a string StringMember and a double DoubleMember): -\code -int MyKind::setParameter(std::string name, std::string content) { - if (name=="StringMember") setStringMember(content); - else if (name=="DoubleMember") setDoubleMemeber(atof(content.c_str())); - else return Generic::setParameter(name, content); - return 0; -} -\endcode + * \code + * int MyKind::setParameter(std::string name, + * std::string content, + * std::string unit) { + * if (name=="StringMember") setStringMember(content); + * else if (name=="DoubleMember") setDoubleMember(atof(content.c_str()), + * unit); + * else return Generic::setParameter(name, content, unit); + * return 0; + * } + * \endcode * If MyKind is not a direct subclass of Generic but is a subclass * of e.g. Standard, UniformSphere of ThinDisk, it should call the * corresponding setParameter() implementation instead of @@ -338,41 +382,45 @@ * * \param name XML name of the parameter * \param content string representation of the value + * \param unit string representation of the unit * \return 0 if this parameter is known, 1 if it is not. */ - virtual int setParameter(std::string name, std::string content) ; - ///< Called from setParameters() + virtual int setParameter(std::string name, + std::string content, + std::string unit) ; #ifdef GYOTO_USE_XERCES /** + * \brief Fill XML section + * * Astrobj implementations should impement fillElement to save their * parameters to XML and call the generic implementation to save * generic parts such as Flag_radtrans: Generic::fillElement(fmp). */ - virtual void fillElement(FactoryMessenger *fmp) const ; - ///< called from Factory /** + * \brief Main loop in Subcontractor_t function + * * The Subcontractor_t function for each Astrobj kind should look - * somewhat like this: -\code -SmartPointer -Gyoto::Astrobj::MyKind::Subcontractor(FactoryMessenger* fmp) { - SmartPointer ao = new MyKind(); - ao -> setParameters(fmp); - return ao; -} -\endcode + * somewhat like this (templated as + * Gyoto::Astrobj::Subcontractor): + * \code + * SmartPointer + * Gyoto::Astrobj::MyKind::Subcontractor(FactoryMessenger* fmp) { + * SmartPointer ao = new MyKind(); + * ao -> setParameters(fmp); + * return ao; + * } + * \endcode * * Each object kind should implement setParameter(string name, - * string content) to interpret the individual XML + * string content, string unit) to interpret the individual XML * elements. setParameters() can be overloaded in case the specific * Astrobj class needs low level access to the FactoryMessenger. See * UniformSphere::setParameters(). */ virtual void setParameters(FactoryMessenger *fmp); - ///< Main loop in Subcontractor_t function #endif @@ -413,14 +461,16 @@ */ virtual int Impact(Gyoto::Photon* ph, size_t index, Astrobj::Properties *data=NULL) = 0 ; - ///< does a photon at these coordinates impact the object? + ///< Does a photon at these coordinates impact the object? /** + * \brief Fills Astrobj::Properties + * * processHitQuantities fills the requested data in Impact. To use * it, you need to call it in the Impact() method for your object in * case of hit. It will fill Redshift, Intensity, Spectrum, * BinSpectrum and update the Photon's transmission by calling - * Photon::transmi(), only if data==NULL. + * Photon::transmit(), only if data==NULL. * * You can overload it for your Astrobj. The generic implementation * calls emission(), integrateEmission() and transmission() below. @@ -430,60 +480,108 @@ Astrobj::Properties* data) const; /** + * \brief Specific intensity Iν + * * Called by the default implementation for processHitQuantities(). * - * emission() computes the intensity I_nu emitted by the small - * volume of length dsem. It should take self-absorption along dsem - * into account. + * emission() computes the intensity Iν emitted by the + * small volume of length dsem, in the emitter's + * frame. It should take self-absorption along dsem into + * account. * * Reminder : - * - intensity = I_nu [erg cm^-2 s^-1 ster^-1 Hz^-1]; - * - invariant intensity = I_nu/nu^3, which has the same value in any frame; - * - emission coefficient = j_nu [erg cm^-3 s^-1 ster^-1 Hz^-1] , - * defined by dI_nu = j_nu*ds, where ds is the distance - * travelled by the photon inside the object; - * - invariant emission coef = j_nu/nu^2, which has the same value - * in any frame. + * - intensity = Iν [J m^-2 s^-1 ster^-1 Hz^-1]; + * + * - invariant intensity = Iν3, which + * has the same value in any frame; + * + * - emission coefficient = jν [J m^-3 s^-1 ster^-1 + * Hz^-1] , defined by dIν = jν*ds, + * where ds is the distance travelled by the photon inside the + * object; + * - invariant emission coef = jν2, + * which has the same value in any frame. * * The equation used for radiative transfer (without absorption) is: - * d(I_nu/nu^3)/dlambda = (j_nu/nu^2) [*] - * where lambda is the integration parameter along the null geodesic. * - * NB: Let us consider a particular observer, - * with nu being the frequency measured by this observer, - * and ds being the proper distance (as measured by the observer) - * that the photon travels as it moves - * from lambda to lambda+dlambda along its geodesic. - * Then it can be shown that : - * dlambda = ds/nu - * This shows that Eq. [*] is homogeneous. + * d(Iν3)/dλ = (jν2) [*] * - * The default implementation returns 1. if optically thick and dsem + * where λ is the integration parameter along the null geodesic. + * + * NB: Let us consider a particular observer, with ν being the + * frequency measured by this observer, and ds being the proper + * distance (as measured by the observer) that the photon travels + * as it moves from λ to λ+dλ along its + * geodesic. Then it can be shown that: + * + * dλ = ds/ν + * + * This shows that Eq. [*] is homogeneous. + * + * The default implementation returns 1. if optically thick and dsem * if optically thin. It allows for a quick implementation of your * object for visualization purposes. * - * \param nu_em Frequency at emission + * \param nu_em Frequency at emission [Hz] * \param dsem length over which to integrate inside the object + * [geometrical units] * \param coord_ph Photon coordinate * \param coord_obj Emitter coordinate at current photon position */ virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]=NULL) - const ; ///< INVARIANT emission j_{\nu}/\nu^{2} + const ; /** - * Compute the integral of emission() from nu1 to nu2. The default - * implementation is a numerical integrator which works well enough - * and is reasonably fast if emission() is a smooth function - * (i.e. no emission or absorption lines). If possible, it is wise - * to implement an analytical solution. It is used by - * processHitQuantities to compute the "BinSpectrum" quantity which - * is the most physical: it is the only quantity that can be - * actually measured directly by a real-life instrument. + * \brief Specific intensity Iν for several values of νem + * + * Called by the default implementation for processHitQuantities(). + * + * emission() computes the intensity Iν emitted by the small + * volume of length dsem. It should take self-absorption along dsem + * into account. + * + * Same as emission(double nu_em, double dsem, double coord_ph[8], + * double coord_obj[8]=NULL) const + * looping on several values of nu_em. + * + * \param Inu[nbnu] Output (must be set to a previously allocated + * array of doubles) + * \param nu_em[nbnu] Frequencies at emission + * \param nbnu Size of Inu[] and nu_em[] + * \param dsem Length over which to integrate inside the object + * \param coord_ph Photon coordinate + * \param coord_obj Emitter coordinate at current photon position + * \return Iν or dIν [W m-2 sr-2] + */ + virtual void emission(double Inu[], double nu_em[], size_t nbnu, + double dsem, double coord_ph[8], + double coord_obj[8]=NULL) const ; + + /** + * Compute the integral of emission() from ν1 to + * ν2. The default implementation is a numerical + * integrator which works well enough and is reasonably fast if + * emission() is a smooth function (i.e. no emission or absorption + * lines). If possible, it is wise to implement an analytical + * solution. It is used by processHitQuantities to compute the + * "BinSpectrum" quantity which is the most physical: it is the only + * quantity that can be actually measured directly by a real-life + * instrument. */ virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const; - ///< \sum_nu1^nu2 I_nu dnu (or j_nu) + ///< ∫ν1ν2 Iν dν (or jν) + + /** + * Like double integrateEmission(double nu1, double nu2, double + * dsem, double c_ph[8], double c_obj[8]) const for each + * Spectrometer channel. + */ + virtual void integrateEmission(double * I, double const * boundaries, + size_t const * chaninds, size_t nbnu, + double dsem, double *cph, double *co) const; + ///< ∫ν1ν2 Iν dν (or jν) /** * transmission() computes the transmission of this fluid element or @@ -495,16 +593,7 @@ * \param dsem geometrical length in geometrical units */ virtual double transmission(double nuem, double dsem, double coord[8]) const ; - ///< Transmission: exp( \alpha_{\nu} * dsem ) - - /** - * checkPhiTheta() Modifies coord if the corrdinates are spherical-like - * so that coord[2]=theta is in [0,pi] and coord[3]=phi is in [0,2pi]. - * Important to use in all astrobj in spherical coordinates - * to prevent "z-axis problems". - */ - void checkPhiTheta(double coord[8]) const; - + ///< Transmission: exp( αν * dsem ) }; @@ -512,28 +601,165 @@ * \class Gyoto::Astrobj::Properties * \brief Observable properties of an Astronomical object * - * The sort of properties one wants to measure on a ray-traced Gyoto::Photon which hits a Gyoto::Astrobj. Not all Astrobj are able to fill all of these properties. + * The sort of properties one wants to measure on a ray-traced + * Gyoto::Photon which hits a Gyoto::Astrobj. Not all Astrobj are + * able to fill all of these properties. * + * An instance of Properties essentially contains a bunch of pointers + * to memory areas where the observable quantities (see Quantity_t) + * should be stored. + * + * Astrobj::Generic::processHitQuantities() fills the various arrays + * upon request. A quantity is ignored if the corresponding pointer + * is NULL. + * + * Scenery::operator()() increments the Properties between each + * Photon using Properties::operator++(). + * + * The main application (gyoto, the yorick plug-in, or your user + * application) is responsible for allocating the various arrays, + * filling the various members of Properties, and doing whatever + * meaninful with the arrays after they have been filled with values + * by the ray-tracing code (e.g. saving them to disk or displaying + * them). + * + * Also see Gyoto::Scenery and Gyoto::Quantity_t. */ class Gyoto::Astrobj::Properties : protected Gyoto::SmartPointee { friend class Gyoto::SmartPointer; public: - double *intensity; ///< Apparent intensity (takes beaming into account); - double *time; ///< Date of impact (= date of emission of the photon); - double *distance; ///< Behaves like the square of the closest distance between Photon and Astrobj (but not exactly that). Initialize it to DBL_MAX from float.h.; - double * first_dmin; ///< first local minimum in distance from object - int first_dmin_found; ///< first_dmin will be set to the first local minimum and first_dmin_found will be set to 1 if a local minimum in distance is found. Initialize it to 0. - double *redshift; ///< redshift factor nuobs/nuem (necessary for emission lines computation) - double *spectrum; ///< I_nu (nu) (observed specific intensity) - double *binspectrum; ///< I_nu1^nu2, the integral of I_nu over each spectral channel (i.e. what a spectrometer would measure) - int offset; ///< spectra elements are separated by offset doubles in memory. In other words, the ith spectral element is a spectrum[i*offset]. - double * impactcoords; ///< Coordinates of the object and photon at impact - double *user1, *user2, *user3, *user4, *user5; ///< Quantities specific to Astrobj + double *intensity; ///< GYOTO_QUANTITY_INTENSITY : Intensity + double *time; ///< GYOTO_QUANTITY_EMISSIONTIME: EmissionTime + + /** + * Behaves like the square of the closest distance between Photon + * and Astrobj (but not exactly that). Initialize it to DBL_MAX from + * float.h.; + */ + double *distance; ///< GYOTO_QUANTITY_MIN_DISTANCE: MinDistance + + /** + * First local minimum in distance from object + */ + double * first_dmin; ///< GYOTO_QUANTITY_FIRST_DMIN : FirstDmin + + /** + * Properties::first_dmin will be set to the first local minimum and + * Properties::first_dmin_found will be set to 1 if a local minimum + * in distance is found. Initialize it to 0. + */ + int first_dmin_found; ///< Whether Properties::first_dmin was found + + /** + * Redshift factor νobsem (necessary + * for emission lines computation) + */ + double *redshift; ///< GYOTO_QUANTITY_REDSHIFT : RedShift + + /** + * Iν (ν) (observed specific intensity) + */ + double *spectrum; ///< GYOTO_QUANTITY_SPECTRUM : Spectrum + + /** + * Iν1ν2, the + * integral of Iν over each spectral channel + * (i.e. what a spectrometer would measure) + */ + double *binspectrum; ///< GYOTO_QUANTITY_BINSPECTRUM : BinSpectrum + + /** + * Spectra elements are separated by offset doubles in memory. In + * other words, the ith spectral element is spectrum[i*offset]. + */ + int offset; ///< How to jump from one spectral element to the next + + /** + * Coordinates of the object and photon at impact + */ + double * impactcoords; ///< GYOTO_QUANTITY_IMPACTCOORDS: ImpactCoords + + /** + * \brief GYOTO_QUANTITY_USER1 : User1 + * Astrobj-specific quantity + */ + double *user1; + + /** + * \brief GYOTO_QUANTITY_USER2 : User2 + * Astrobj-specific quantity + */ + double *user2; + + /** + * \brief GYOTO_QUANTITY_USER3 : User3 + * Astrobj-specific quantity + */ + double *user3; + + /** + * \brief GYOTO_QUANTITY_USER4 : User4 + * Astrobj-specific quantity + */ + double *user4; + + /** + * \brief GYOTO_QUANTITY_USER5 : User5 + * Astrobj-specific quantity + */ + double *user5; +# ifdef HAVE_UDUNITS + /** + * \brief Converter between SI (J.m -2.s-1.sr-1.Hz-1) and requested Intensity unit + */ + Gyoto::SmartPointer intensity_converter_ ; + /** + * \brief Converter between SI (J.m -2.s-1.sr-1.Hz-1) and requested Spectrum unit + */ + Gyoto::SmartPointer spectrum_converter_ ; + /** + * \brief Converter between SI (J.m -2.s-1.sr-1) and requested BinSpectrum unit + */ + Gyoto::SmartPointer binspectrum_converter_ ; +# endif public: Properties(); ///< Default constructor (everything is set to NULL); - Properties (double*, double*); ///<< set intensity and time pointers. + Properties (double*, double*); ///<< Set intensity and time pointers. + + /** + * \brief Initialize observable quantities + * + * The pointed-to values are initialized as follows (if the + * corresponding pointer is not NULL): + * + * - intensity, firt_dmin_found, redshift, userN: 0 + * - time, distance, first_dmin: DBL_MAX + * - for spectrum and binspectrum, nbnuobs values separated by offset in memory are initialized to 0 + * - for impactcoords, 16 contiguous values are initialized to DBL_MAX + */ void init(size_t nbnuobs=0); + + /** + * \brief Increment pointers + * + * All valid pointers are incremented by 1 (sizeof(double)), excepted + * impactcoords which is incremented by 16. + */ Properties operator++(); +# ifdef HAVE_UDUNITS + void setIntensityConverter(Gyoto::SmartPointer); + ///< Set Properties::intentity_converter_ + void setIntensityConverter(std::string); + ///< Set Properties::intentity_converter_ + void setSpectrumConverter(Gyoto::SmartPointer); + ///< Set Properties::spectrum_converter_ + void setSpectrumConverter(std::string); + ///< Set Properties::spectrum_converter_ + void setBinSpectrumConverter(Gyoto::SmartPointer); + ///< Set Properties::binspectrum_converter_ + void setBinSpectrumConverter(std::string); + ///< Set Properties::binspectrum_converter_ +# endif }; #endif diff -Nru gyoto-0.0.3/include/GyotoBlackBodySpectrum.h gyoto-0.1.0/include/GyotoBlackBodySpectrum.h --- gyoto-0.0.3/include/GyotoBlackBodySpectrum.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoBlackBodySpectrum.h 2013-07-27 09:14:20.000000000 +0000 @@ -29,7 +29,7 @@ #ifndef __GyotoBlackBodySpectrum_H_ #define __GyotoBlackBodySpectrum_H_ -#include +#include "GyotoSpectrum.h" namespace Gyoto { namespace Spectrum { @@ -41,7 +41,15 @@ * \class Gyoto::Spectrum::BlackBody * \brief Black Body * - * Light emitted by e.g. a Star + * Light emitted by e.g. a Star. + * + * Example XML entity: + * \code + * + * 6000 + * 1. + * + * \endcode * */ class Gyoto::Spectrum::BlackBody : public Gyoto::Spectrum::Generic { @@ -53,39 +61,28 @@ public: BlackBody(); + + /** + * \brief Constructor setting T_ and cst_ + */ BlackBody(double T, double scaling=1.); - // BlackBody(const Spectrum &); virtual BlackBody * clone() const; ///< Cloner double getTemperature() const; ///< Get constant - void setTemperature(double); + void setTemperature(double); ///< Set constant double getScaling() const; ///< Get exponent - void setScaling(double); + void setScaling(double); ///< Set exponent using Gyoto::Spectrum::Generic::operator(); virtual double operator()(double nu) const; - ///< I_nu = mySpectrum(nu), nu in Hz. Assumes infinite optical thickness #ifdef GYOTO_USE_XERCES - /** - * Spectrum implementations should impement fillElement to save their - * parameters to XML and call the generic implementation to save - * generic parts. - */ + virtual void setParameter(std::string name, + std::string content, + std::string unit); virtual void fillElement(FactoryMessenger *fmp) const ; - ///< called from Factory #endif }; -#ifdef GYOTO_USE_XERCES -namespace Gyoto { - namespace Spectrum { - Gyoto::SmartPointer - BlackBodySubcontractor(Gyoto::FactoryMessenger* fmp = NULL); - void BlackBodyInit(); - } -} -#endif - #endif diff -Nru gyoto-0.0.3/include/GyotoComplexAstrobj.h gyoto-0.1.0/include/GyotoComplexAstrobj.h --- gyoto-0.0.3/include/GyotoComplexAstrobj.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoComplexAstrobj.h 2013-07-27 09:14:20.000000000 +0000 @@ -40,35 +40,34 @@ * \class Gyoto::Astrobj::Complex * \brief Complex astronomical object * - * A Gyoto::Astrobj::Generic whic contain several - * Gyoto::Astrobj::Generic instances. It is essentially a - * SmartPointer array, which some methods - * arround. Indeed, the operator[](size_t i) method is implemented to retrived - * the i-th element. + * A Gyoto::Astrobj::Generic whic contain several + * Gyoto::Astrobj::Generic instances. It is essentially a + * SmartPointer array, which some methods + * around. Indeed, the operator[](size_t i) method is implemented to + * retrieve the i-th element. * - * In an XML description, the - * <Astrobj> section must be unique, its kind is - * "Complex". Each sub-astrobj then appears as a - * <SubAstrobj> subsection: -\code - - - - 2. - 0. 0. 0.037037 - 600. 9. 1.5707999999999999741 0 - - 0 - 0.001 - - - 0 - 0.01 - - - - -\endcode + * In an XML description, the <Astrobj> section must be unique, + * its kind is "Complex". Each sub-astrobj then appears as a + * <SubAstrobj> subsection: + * \code + * + * + * + * 2. + * 0. 0. 0.037037 + * 600. 9. 1.5707999999999999741 0 + * + * 0 + * 0.001 + * + * + * 0 + * 0.01 + * + * + * + * + * \endcode * */ class Gyoto::Astrobj::Complex : public Gyoto::Astrobj::Generic { @@ -79,13 +78,19 @@ protected: /** - * Number of objects + * \brief Number of objects */ size_t cardinal_; + /** + * \brief Array of Astrobj::Generic + */ Gyoto::SmartPointer * elements_; - double step_max_; + /** + * Currently not settable, always equal to GYOTO_DEFAULT_DELTA + */ + double step_max_; ///< Maximum δ step inside the Astrobj public: Complex(); ///< Default constructor. @@ -150,20 +155,19 @@ /** * This should work as expected: -\code - SmartPointer cplx; - SmartPointer objA; - SmartPointer objB; - cplx -> append(objA); - cplx[0] = objB; -\endcode + * \code + * SmartPointer cplx; + * SmartPointer objA; + * SmartPointer objB; + * cplx -> append(objA); + * cplx[0] = objB; + * \endcode */ Gyoto::SmartPointer operator[](size_t i) ; ///< Retrieve i-th element. Gyoto::SmartPointer const operator[](size_t i) const; ///< Retrieve a const version of the i-th element. - protected: }; #endif diff -Nru gyoto-0.0.3/include/GyotoComplexSpectrometer.h gyoto-0.1.0/include/GyotoComplexSpectrometer.h --- gyoto-0.0.3/include/GyotoComplexSpectrometer.h 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/include/GyotoComplexSpectrometer.h 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,188 @@ +/** + * \file GyotoComplexSpectrometer.h + * \brief Combine spectrometer objects + * + * A spectrometer made of several spectrometers + */ + +/* + Copyright 2013 Thibaut Paumard, Frederic Vincent + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + + +#ifndef __GyotoComplexSpectrometer_H_ +#define __GyotoComplexSpectrometer_H_ + +#include + +namespace Gyoto{ + namespace Spectrometer { + class Complex; + } +} + +/** + * \class Gyoto::Spectrometer::Complex + * \brief Complex spectrometer object + * + * A Gyoto::Spectrometer::Generic whic contain several + * Gyoto::Spectrometer::Generic instances. It is essentially a + * SmartPointer array, which some methods + * arround. Indeed, the operator[](size_t i) method is implemented to + * retrieve the i-th element. + * + * In an XML description, the <Spectrometer> section is unique, + * its kind is "Complex". Each sub-spectrometer then appears as a + * <SubSpectrometer> subsection. For instance, to compute 10 + * channels ovr the K infrared band plus 10 channels in the high + * energy domain: + * \code + * + * + * 2.0 2.4 + * + * + * 14 22 + * + * + * \endcode + * + */ +class Gyoto::Spectrometer::Complex +: public Gyoto::Spectrometer::Generic, + public Gyoto::Hook::Listener +{ + friend class Gyoto::SmartPointer; + + // Data : + // ----- + protected: + + /** + * \brief Number of subspectrometers + * + * Size of elements_. + */ + size_t cardinal_; + + /** + * \brief Actual array of SmartPointer objects + */ + Gyoto::SmartPointer * elements_; + + + public: + Complex(); ///< Default constructor. + Complex(const Complex& ) ; ///< Copy constructor. + + /** + * \brief Clone an instance + * + * Use this to get a deep copy of an instance; + * \code + * SmartPointer myclone = orig->clone(); + * \endcode + * + * Most implementations will use the copy constructor: + * \code + * Generic* Uniform::clone() const { return new Uniform(*this); } + * \endcode + */ + virtual Complex* clone() const; + + /** + * Frees every SmartPointer before freed the + * array itself. + */ + virtual ~Complex() ; ///< Destructor + + // Mutators + // -------- + public: + /** + * If the Spectrometer::Complex itself does not have a metric already + * assigned, it takes it from the new element. Else, it sets the + * metric in the new element to its own. This ensures that all + * elements use the same metric (this heuristic is not entirely + * fool-proof, it's safer to set the metric directly in the + * Spectrometer::Complex). + */ + void append(Gyoto::SmartPointer element); + ///< Add element at the end of the array. + void remove(size_t i); + ///< Remove i-th element from the array. + size_t getCardinal() const; + ///< Get the number of elements in the array. + + virtual void tell(Gyoto::Hook::Teller *msg); + + public: +#ifdef GYOTO_USE_XERCES + /** + * \brief Fill in the XML entity + * + * Loops on elements_[i]->fillElement(); + */ + virtual void fillElement(FactoryMessenger *fmp) const ; + + /** + * \brief Main loop in the (templated) subcontractor + * + * In the case of Spectrometer::Complex, the setParameter() API is + * not sufficient: setParameters() needs acces to the + * FactoryMessenger to instanciate childs for the SubSpectrometers. + */ + virtual void setParameters(FactoryMessenger *fmp); +#endif + + // Outputs + // ------- + public: + + /** + * This should work as expected: +\code + SmartPointer cplx; + SmartPointer objA; + SmartPointer objB; + cplx -> append(objA); + cplx[0] = objB; +\endcode + */ + Gyoto::SmartPointer operator[](size_t i) ; + ///< Retrieve i-th element. + Gyoto::SmartPointer const operator[](size_t i) const; + ///< Retrieve a const version of the i-th element. + + /** + * \brief "Complex" + * + * Use this static member attribute to check whether a Spectrometer + * object spectro is of kind Complex: + * \code + * if (spectro->getKind() == Complex::Kind) ... ; + * \endcode + * + */ + static kind_t const Kind; + + + protected: +}; + +#endif diff -Nru gyoto-0.0.3/include/GyotoConfig.h.in gyoto-0.1.0/include/GyotoConfig.h.in --- gyoto-0.0.3/include/GyotoConfig.h.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/include/GyotoConfig.h.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,297 @@ +/** + * \file GyotoConfig.h + * \brief Compile-time configuration + * + * Codes based on Gyoto and Gyoto plug-ins must have access to the + * flags used when compiling Gyoto. This files is generated by Gyoto's + * configure script and holds influential variables such as + * HAVE_SINCOS. + * + * The values determined by configure when this documentation was + * built are documented, replaced by "(undefined)" if the macro was + * undefined. + */ +/* + Copyright 2012 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#ifndef __GyotoConfig_H_ +#define __GyotoConfig_H_ + +/** \def GYOTO_DEBUG_ENABLED + \brief Whether debugging information gathering code was enabled. */ +#undef GYOTO_DEBUG_ENABLED +#ifdef DOXYGEN_RUN +# ifndef GYOTO_DEBUG_ENABLED +# define GYOTO_DEBUG_ENABLED (undefined) +# endif +#endif + +/** \def GYOTO_PLUGIN_SFX + \brief Suffix for Gyoto plug-ins. */ +#undef GYOTO_PLUGIN_SFX +#ifdef DOXYGEN_RUN +# ifndef GYOTO_PLUGIN_SFX +# define GYOTO_PLUGIN_SFX (undefined) +# endif +#endif + +/** \def GYOTO_PREFIX + \brief Gyoto prefix. */ +#undef GYOTO_PREFIX +#ifdef DOXYGEN_RUN +# ifndef GYOTO_PREFIX +# define GYOTO_PREFIX (undefined) +# endif +#endif + +/** \def GYOTO_SOVERS + \brief Gyoto ABI version. + + Updated in stable releases, not during dev. cycle. */ +#undef GYOTO_SOVERS +#ifdef DOXYGEN_RUN +# ifndef GYOTO_SOVERS +# define GYOTO_SOVERS (undefined) +# endif +#endif + +/** \def GYOTO_USE_CFITSIO + * \brief Whether cfitsio support is compiled-in. + * + * Necessary for FITS file format i/o, used in the Gyoto tool and + * optional in Gtyoto::PatternDisk. + */ +#undef GYOTO_USE_CFITSIO +#ifdef DOXYGEN_RUN +# ifndef GYOTO_USE_CFITSIO +# define GYOTO_USE_CFITSIO (undefined) +# endif +#endif + +/** \def GYOTO_USE_LORENE + \brief Whether Lorene support is compiled-in. + + Used only in the lorene plug-in. + */ +#undef GYOTO_USE_LORENE +#ifdef DOXYGEN_RUN +# ifndef GYOTO_USE_LORENE +# define GYOTO_USE_LORENE (undefined) +# endif +#endif + +/** \def GYOTO_USE_XERCES + \brief Whether Xerces support (XML i/o) is compiled-in. + + Used only in the Gyoto::Factory but Gyoto build is not often + tested without it. + */ +#undef GYOTO_USE_XERCES +#ifdef DOXYGEN_RUN +# ifndef GYOTO_USE_XERCES +# define GYOTO_USE_XERCES (undefined) +# endif +#endif + +/** \def HAVE_DLFCN_H + \brief Whether header file was found. */ +#undef HAVE_DLFCN_H +#ifdef DOXYGEN_RUN +# ifndef +# define (undefined) +# endif +#endif + +/** \def HAVE_INTTYPES_H + \brief Whether header file was found. */ +#undef HAVE_INTTYPES_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_INTTYPES_H +# define HAVE_INTTYPES_H (undefined) +# endif +#endif + +/** \def HAVE_LIBDL + \brief Whether the `dl' library (-ldl) was found. + + Plug-in support. + */ +#undef HAVE_LIBDL +#ifdef DOXYGEN_RUN +# ifndef HAVE_LIBDL +# define HAVE_LIBDL (undefined) +# endif +#endif + +/** \def HAVE_MEMORY_H + \brief Whether the header file was found. */ +#undef HAVE_MEMORY_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H (undefined) +# endif +#endif + +/** \def HAVE_PTHREAD + * \brief Whether POSIX threads support is compiled-in. + * + * Multi-threading support, see Gyoto::Scenery::nthreads_. + */ +#undef HAVE_PTHREAD +#ifdef DOXYGEN_RUN +# ifndef HAVE_PTHREAD +# define HAVE_PTHREAD (undefined) +# endif +#endif + +/** \def HAVE_PTHREAD_PRIO_INHERIT + \brief Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT +#ifdef DOXYGEN_RUN +# ifndef HAVE_PTHREAD_PRIO_INHERIT +# define HAVE_PTHREAD_PRIO_INHERIT (undefined) +# endif +#endif + +/** \def HAVE_SINCOS + * \brief Whether the `sincos' function is available. + * + * Else Gyoto provides it as a macro in GyotoDefs.h. + */ +#undef HAVE_SINCOS +#ifdef DOXYGEN_RUN +# ifndef HAVE_SINCOS +# define HAVE_SINCOS (undefined) +# endif +#endif + +/** \def HAVE_STDINT_H + \brief Whether the header file was found. */ +#undef HAVE_STDINT_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_STDINT_H +# define HAVE_STDINT_H (undefined) +# endif +#endif + +/** \def HAVE_STDLIB_H + \brief Whether the header file was found. */ +#undef HAVE_STDLIB_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_STDLIB_H +# define HAVE_STDLIB_H (undefined) +# endif +#endif + +/** \def HAVE_STRINGS_H + \brief Whether the header file was found. */ +#undef HAVE_STRINGS_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_STRINGS_H +# define HAVE_STRINGS_H (undefined) +# endif +#endif + +/** \def HAVE_STRING_H + \brief Whether the header file was found. */ +#undef HAVE_STRING_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_STRING_H +# define HAVE_STRING_H (undefined) +# endif +#endif + +/** \def HAVE_SYS_STAT_H + \brief Whether the header file was found. */ +#undef HAVE_SYS_STAT_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_SYS_STAT_H +# define HAVE_SYS_STAT_H (undefined) +# endif +#endif + +/** \def HAVE_SYS_TYPES_H + \brief Whether the header file was found. */ +#undef HAVE_SYS_TYPES_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_SYS_TYPES_H +# define HAVE_SYS_TYPES_H (undefined) +# endif +#endif + +/** \def HAVE_UDUNITS + * \brief Whether libudunits2 support is compiled in. + * + * Foundation for the Gyoto::Units framework. Gyoto ought to build + * and work without it, but with restricted unit conversion + * capabilities. + */ +#undef HAVE_UDUNITS +#ifdef DOXYGEN_RUN +# ifndef HAVE_UDUNITS +# define HAVE_UDUNITS (undefined) +# endif +#endif + +/** \def HAVE_UNISTD_H + \brief Whether the header file was found. */ +#undef HAVE_UNISTD_H +#ifdef DOXYGEN_RUN +# ifndef HAVE_UNISTD_H +# define HAVE_UNISTD_H (undefined) +# endif +#endif + +/** \def HAVE__BOOL + \brief Whether the system has the type `_Bool'. */ +#undef HAVE__BOOL +#ifdef DOXYGEN_RUN +# ifndef HAVE__BOOL +# define HAVE__BOOL (undefined) +# endif +#endif + +/** \def PTHREAD_CREATE_JOINABLE + \brief Define to necessary symbol if this constant uses a non-standard name on your system. */ +#undef PTHREAD_CREATE_JOINABLE +#ifdef DOXYGEN_RUN +# ifndef PTHREAD_CREATE_JOINABLE +# define PTHREAD_CREATE_JOINABLE (undefined) +# endif +#endif + +/** \def STDC_HEADERS + \brief Whether the ANSI C header files were found. */ +#undef STDC_HEADERS +#ifdef DOXYGEN_RUN +# ifndef STDC_HEADERS +# define STDC_HEADERS (undefined) +# endif +#endif + +/** \def size_t + \brief If not defined in . */ +#undef size_t +#ifdef DOXYGEN_RUN +# ifndef size_t +# define size_t (undefined) +# endif +#endif + +#endif diff -Nru gyoto-0.0.3/include/GyotoConverters.h gyoto-0.1.0/include/GyotoConverters.h --- gyoto-0.0.3/include/GyotoConverters.h 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/include/GyotoConverters.h 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,508 @@ +/** + * \file GyotoConverters.h + * \brief GYOTO converters + * + * As a (recommended) option, Gyoto can use the libudunits2 library + * by UCAR/Unidata + * (http://www.unidata.ucar.edu/software/udunits/udunits-2/udunits2.html) + * to perform conversions to and from various units. Since udunits + * parses units, the following are equivalent for instance: + * "mJy.sr-1", "mJy/sr", "1e-3Jy/sr". Gyoto considers every string as + * UTF-8: either use UTF-8 or stay with ASCII. This means "µ" can be + * used for "micro" and powers can be noted as superscripts: m³, + * pix². + * + * In addition to the stock units known by udunits2, Gyoto registers + * the following (which may be used in any context): Jansky (symbol + * Jy), symbol "pc" for parsec, "sunradius", "sunmass", symbol "as" + * for "arcsec". + * + * Other units are context-sensitive: "geometrical" allows converting + * between geometrical units and other legnth units, but only when a + * Metric is defined, and may not be used (yet) in compound + * units. Likewise, "geometrical_time" can be used as duration unit + * whenever a Metric is defined, but not in a compound unit. + * + * When a Screen is defined, "pix" can be used as an angle unit (you + * need to call Screen::mapPixUnit() and Screen::unmapScreenUnit(), + * which is done automatically in certain contexts). + * + * Units can often be specified using the "unit" XML attribute: + * \code + * + * + * 4e6 + * + * + * + * + * 8 + * + * + * 150 + * + * + * \endcode + * + * Units for output quantities are specified after the name of the + * quantity, in squared brackets, e.g.: + * \code + * + * Spectrum[erg.s-1.cm-2.sr-1.Hz-1] + * + * \endcode + * or + * \code + * + * Spectrum[mJy/pix²] + * + * \endcode + */ + +/* + Copyright 2011 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#ifndef __GyotoConverters_H_ +#define __GyotoConverters_H_ + +#include +#include + +#ifdef HAVE_UDUNITS +#include +#endif + +#include +#include + +namespace Gyoto { + namespace Metric { + class Generic; + } + namespace Units { + /** + * \namespace Gyoto::Units + * \brief Units-related classes and functions + */ +#ifdef HAVE_UDUNITS + /** + * \class Gyoto::Units::Unit + * \brief Wrapper around ut_unit from udunits + * + * Gyoto::Units::Unit objects usually cast seamlessly to and from + * udunits2 ut_unit* and std::string. + */ + class Unit; + + /** + * \class Gyoto::Units::Converter + * \brief Wrapper around ut_converter from udunits + * + * A Gyoto::Units::Converter object is a functor and can be used + * to convert efficiently between the two units specified at + * instantiation time: + * + * \code + * Gyoto::Units::Unit from_unit ("erg.s-1.cm-2.sr-1.Hz-1"), + * to_unit ("mJy/µas²"); + * double data_in[1000], data_out[1000]; + * Converter conv(from_unit, to_unit); + * for (size_t i=0; i<1000; ++i) data_out[i] = conv(data_in[i]); + * \endcode + * + * Since std::string cast automatically to Gyoto::Units::Unit + * object, this is equivalent: + * + * \code + * Converter conv("erg.s-1.cm-2.sr-1.Hz-1", "mJy/µas²"); + * for (size_t i=0; i<1000; ++i) data_out[i] = conv(data_in[i]); + * \endcode + */ + class Converter; + + /** + * \brief Retrieve the unit system used in all of Gyoto + */ + ut_system * getSystem(); +#endif + + /** + * \brief Load and initialize all (non-context-sensitive) units + * + * If udunits is used (preprocessor macro HAVE_UDUNITS), Init() + * initializes the ut_system used throughout Gyoto and maps a few + * additional units to the unit system. + */ + void Init(); + + /** + * \brief Convert from arbitrary length unit to meters + * + * Convert value from unit represented by "unit" to meters. + * + * If gg is provided (and not NULL), use it to interpret the + * string "geometrical" as representing + * gg->Gyoto::Metric::Generic::unitLength(). + * + * ToMeters() will also convert time, frequency and energy units + * to meters (as in frequency -> wavelength). + * + * \param value + * (double) the value to convert, expressed according to "unit" + * \param unit (std::string) the "unit" from which to convert, + * e.g. "km", "sunradius" or "geometrical". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &, + * NULL if not specified) optional metric to interpret + * "geometrical". + * + * \return value, expressed in meters. + */ + double ToMeters(double value, const std::string &unit, + const Gyoto::SmartPointer &gg=NULL); + + /** + * \brief Convert to arbitrary length unit from meters + * + * Convert value to unit represented by "unit" from meters. + * + * If gg is provided (and not NULL), use it to interpret the + * string "geometrical" as representing + * gg->Gyoto::Metric::Generic::unitLength(). + * + * ToMeters() will also convert to time, frequency and energy + * units (as in wavelength -> frequency). + * + * \param value + * (double) the value to convert, expressed in meters. + * \param unit (std::string) the "unit" to which to convert, + * e.g. "km", "sunradius" or "geometrical". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &, + * NULL if not specified) optional metric to interpret + * "geometrical". + * + * \return value, expressed in "unit". + */ + double FromMeters(double value, const std::string &unit, + const Gyoto::SmartPointer &gg=NULL); + + /** + * \brief Convert from arbitrary time unit to seconds + * + * Convert value from unit represented by "unit" to seconds. + * + * If gg is provided (and not NULL), use it to interpret the + * string "geometrical_time" as representing + * gg->Gyoto::Metric::Generic::unitLength()/GYOTO_C. + * + * \param value + * (double) the value to convert, expressed according to "unit" + * \param unit (std::string) the "unit" from which to convert, + * e.g. "s", "yr" or "geometrical_time". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &, + * NULL if not specified) optional metric to interpret + * "geometrical". + * + * \return value, expressed in seconds. + */ + double ToSeconds(double value, const std::string &unit, + const Gyoto::SmartPointer &gg=NULL); + + /** + * \brief Convert to arbitrary time unit from seconds + * + * Convert value to unit represented by "unit" from seconds. + * + * If gg is provided (and not NULL), use it to interpret the + * string "geometrical_time" as representing + * gg->Gyoto::Metric::Generic::unitLength()/GYOTO_C. + * + * \param value + * (double) the value to convert, expressed in seconds. + * \param unit (std::string) the "unit" to which to convert, + * e.g. "s", "yr" or "geometrical_time". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &, + * NULL if not specified) optional metric to interpret + * "geometrical". + * + * \return value, expressed in "unit". + */ + double FromSeconds(double value, const std::string &unit, + const Gyoto::SmartPointer &gg=NULL); + + /** + * \brief Convert from arbitrary mass unit to kilograms + * + * Convert value from unit represented by "unit" to kilograms. + * + * \param value + * (double) the value to convert, expressed according to "unit" + * \param unit (std::string) the "unit" from which to convert, + * e.g. "g", "kg" or "sunmass". More units are + * supported if Gyoto was compiled with udunits support. + * + * \return value, expressed in kilograms. + */ + double ToKilograms(double value, const std::string & unit); + + /** + * \brief Convert to arbitrary mass unit from kilograms + * + * Convert value from unit represented by "unit" from kilograms. + * + * \param value + * (double) the value to convert, expressed inkilograms. + * \param unit (std::string) the "unit" to which to convert, + * e.g. "g", "kg" or "sunmass". More units are + * supported if Gyoto was compiled with udunits support. + * + * \return value, expressed in "unit". + */ + double FromKilograms(double value, const std::string & unit); + + /** + * \brief Convert from arbitrary length unit to geometrical units + * + * Convert value from unit represented by "unit" to geometrical units. + * + * \param value + * (double) the value to convert, expressed according to "unit". + * \param unit (std::string) the "unit" from which to convert, + * e.g. "km", "sunradius" or "geometrical". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &) + * metric to interpret "geometrical". + * + * \return value, expressed in geometrical units. + */ + double ToGeometrical(double value, const std::string & unit, + const Gyoto::SmartPointer & gg); + + /** + * \brief Convert to arbitrary length unit from geometrical units + * + * Convert value to unit represented by "unit" from geometrical units. + * + * \param value + * (double) the value to convert, expressed in geometrical units. + * \param unit (std::string) the "unit" to which to convert, + * e.g. "km", "sunradius" or "geometrical". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &) + * metric to interpret "geometrical". + * + * \return value, expressed in "unit". + */ + double FromGeometrical(double value, const std::string & unit, + const Gyoto::SmartPointer & gg); + + /** + * \brief Convert from arbitrary time unit to geometrical units + * + * \param value + * (double) the value to convert, expressed according to "unit". + * \param unit (std::string) the "unit" from which to convert, + * e.g. "s", "kyr" or "geometrical_time". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &) + * metric to interpret "geometrical_time". + * + * \return value, expressed in geometrical (time) units. + */ + double ToGeometricalTime(double value, const std::string & unit, + const Gyoto::SmartPointer & gg); + + /** + * \brief Convert to arbitrary time unit from geometrical units + * + * \param value + * (double) the value to convert, expressed in geometrical units. + * \param unit (std::string) the "unit" to which to convert, + * e.g. "yr", "s" or "geometrical_time". More units are + * supported if Gyoto was compiled with udunits support. + * \param gg (const Gyoto::SmartPointer &) + * metric to interpret "geometrical_time". + * + * \return value, expressed in "unit". + */ + double FromGeometricalTime(double value, const std::string & unit, + const Gyoto::SmartPointer &gg); + + + /** + * \brief Convert from arbitrary frequency unit to Herz + * + * ToHerz will also convert from length and energy units (such as + * "eV"). + * + * \param value + * (double) the value to convert, expressed according to "unit". + * \param unit (std::string) the "unit" from which to convert, + * e.g. "MHz", "keV" + * + * \return value, expressed in "Hz". + */ + double ToHerz(double value, const std::string &unit); + + /** + * \brief Convert to arbitrary frequency unit from Herz + * + * FromHerz will also convert to length and energy units (such as + * "eV"). + * + * \param value + * (double) the value to convert, expressed according in "Hz". + * \param unit (std::string) the "unit" from which to convert, + * e.g. "MHz", "keV" + * + * \return value, expressed in "units". + */ + double FromHerz(double value, const std::string &unit); + +# ifdef HAVE_UDUNITS + /** + * \brief Is it possible to convert between unit1 and unit2? + * + * e.g. areConvertible("m", "kg") == 0; areConvertible("m", "km")==1. + * + * Warning: angle units are dimensionless, therefore e.g. + * areConvertible("Jy", "Jy/microacsec2")==1. Numerically, "Jy" is + * the same as "Jy/sr2". + * + * \param unit1 (Gyoto::Units::Unit) first unit + * \param unit2 (Gyoto::Units::Unit) second unit + * + * \return bool, True if it is possible to convert between the two + * units, 0 otherwise. + */ + bool areConvertible(const Unit &unit1, const Unit &unit2); +# endif + } +} + +#ifdef HAVE_UDUNITS +class Gyoto::Units::Unit : protected Gyoto::SmartPointee { + friend class Gyoto::SmartPointer; + friend class Gyoto::Units::Converter; + private: + ut_unit * unit_; ///< the underlying ut_unit (from udunits) + std::string kind_; ///< the string used to instanciate this unit + public: + + /** + * \brief Build Unit described by string + * + * Throws a Gyoto::Error if anything goes wrong. + * + * \param unit string description of the unit, e.g. "mJy/sr2" or "sunmass". + */ + Unit(const std::string &unit); + + /** + * \brief Build Unit described by C string + * + * Throws a Gyoto::Error if anything goes wrong. + * + * \param unit char const * const description of the unit, + * e.g. "mJy/sr2" or "sunmass". + */ + Unit(char const * const unit); + + /** + * \brief Destructor + * + * Frees unit_. + */ + ~Unit(); + + /** + * \brief Convert to Unit + * + * \param val double to convert + * \param from_unit Unit from which to convert + * + * \return value converted to unit_. + */ + double To (double val, const Unit &from_unit); + + /** + * \brief Convert from Unit + * + * \param val double to convert + * \param to_unit Unit to which to convert + * + * \return value converted to "to_unit". + */ + double From (double val, const Unit &to_unit); + + /** + * \brief Cast to string + * + * \return kind_ + */ + operator std::string() const ; + + /** + * \brief Cast to ut_unit* + * + * \return unit_ + */ + operator ut_unit*() const ; +}; + +class Gyoto::Units::Converter : protected Gyoto::SmartPointee { + friend class Gyoto::SmartPointer; + private: + cv_converter * converter_; ///< Underlying ut_converter object from udunits + + public: + Converter(); ///< Construct trivial Converter (Converter()(x)==x) + Converter(const Gyoto::Units::Unit& from, + const Gyoto::Units::Unit& to); + ///< Construct Converter from two Unit + ~Converter(); + ///< Destruct converter, freeing converter_ + + void reset(); ///< Reset to trivial Converter (Converter()(x)==x) + void reset(const Gyoto::Units::Unit& from, + const Gyoto::Units::Unit& to); + ///< Reset to converter from "from" to "to" + + /** + * \brief Actually convert data + * + * The entire Gyoto::Units::Converter class is there just for this + * operator, which converts value from unit "from" to unit "to" + * where "from" and "to" are the two Units passed to the constructor + * Gyoto::Units::Converter::Converter(const Gyoto::Units::Unit& + * from, const Gyoto::Units::Unit& to). + * + * \param value double expressed in Unit from + * + * \return converted value expressed in Unit to + */ + double operator()(double value) const ; +}; + +#endif + +#endif diff -Nru gyoto-0.0.3/include/GyotoDefs.h gyoto-0.1.0/include/GyotoDefs.h --- gyoto-0.0.3/include/GyotoDefs.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoDefs.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,6 +1,6 @@ /** * \file GyotoDefs.h - * \brief #defines and typedefs for Gyoto + * \brief Gyoto ubiquitous macros and typedefs */ /* Copyright 2011 Thibaut Paumard @@ -24,26 +24,30 @@ #ifndef __GyotoDefs_H_ #define __GyotoDefs_H_ +#include "GyotoConfig.h" + +/** + * \brief Replacement for GNU extension sincos + * + * If #HAVE_SINCOS is undefined, Gyoto provides a trivial + * implementation. + * \param[in] t Angle in radian; + * \param[out] s Adress where sin(t) should be stored; + * \param[out] c Adress where cos(t) should be stored. + */ +#if !HAVE_SINCOS +#define sincos(t, s, c) *s=sin(t); *c=cos(t) +#else +# ifdef DOXYGEN_RUN +# define sincos(t, s, c) (undefined) +# endif +#endif /* Typedef for various Gyoto data types */ namespace Gyoto { + //\{ /** - * \brief Spectrometer kind - * - * One of: GYOTO_SPECTRO_KIND_NONE, GYOTO_SPECTRO_KIND_FREQ, - * GYOTO_SPECTRO_KIND_FREQLOG, GYOTO_SPECTRO_KIND_WAVE, - * GYOTO_SPECTRO_KIND_WAVELOG - * - */ - typedef unsigned int SpectroKind_t; -#define GYOTO_SPECTRO_KIND_NONE 0 -#define GYOTO_SPECTRO_KIND_FREQ 1 ///< Spectrometer kind="freq" -#define GYOTO_SPECTRO_KIND_FREQLOG 2 ///< Spectrometer kind="freqlog" -#define GYOTO_SPECTRO_KIND_WAVE 3 ///< Spectrometer kind="wave" -#define GYOTO_SPECTRO_KIND_WAVELOG 4 ///< Spectrometer kind="wavelog" - - /** - * \brief Observable quantities + * \name Observable quantities * * Individual quantities are represented as a variable of this * type. A combination of quantities is an ored list of Quantity_t, @@ -60,114 +64,344 @@ * \endcode * * List of all possible Quantity_t individual values and the - * corresponding string (see Scenery): - * - * - GYOTO_QUANTITY_INTENSITY : Intensity - * - GYOTO_QUANTITY_EMISSIONTIME: EmissionTime - * - GYOTO_QUANTITY_MIN_DISTANCE: MinDistance - * - GYOTO_QUANTITY_FIRST_DMIN : FirstDmin - * - GYOTO_QUANTITY_REDSHIFT : RedShift - * - GYOTO_QUANTITY_SPECTRUM : Spectrum - * - GYOTO_QUANTITY_BINSPECTRUM : BinSpectrum - * - GYOTO_QUANTITY_IMPACTCOORDS: ImpactCoords - * - GYOTO_QUANTITY_USER1 : User1 - * - GYOTO_QUANTITY_USER2 : User2 - * - GYOTO_QUANTITY_USER3 : User3 - * - GYOTO_QUANTITY_USER4 : User4 - * - GYOTO_QUANTITY_USER5 : User5 + * corresponding string (see Gyoto::Scenery) with corresponding XML + * name: */ + + /// Type for observabke quantities typedef unsigned int Quantity_t; -/* Generic */ + + /* Generic */ + + /// Intensity: Iν at Scenery::freq_obs_. #define GYOTO_QUANTITY_INTENSITY 1 + /// EmissionTime: Emission date. #define GYOTO_QUANTITY_EMISSIONTIME 2 + /// MinDistance: Behaves like minimal distance between Photon and Astrobj. + /** + * Not always exactly a distance, though. + */ #define GYOTO_QUANTITY_MIN_DISTANCE 4 + /// FirstDmin: First Photon-Astrobj distance local minimum while integrating back in time. #define GYOTO_QUANTITY_FIRST_DMIN 8 + /// Redshift: νobsem. #define GYOTO_QUANTITY_REDSHIFT 16 + /// ImpactCoords: Astrobj and Photon 8-coordinates at emission. + /** + * A 16-element vector. See Gyoto::Quantity_t. + */ #define GYOTO_QUANTITY_IMPACTCOORDS 32 + /// Spectrum: Iν at each frequency in Scenery::screen_->getMidpoints(). #define GYOTO_QUANTITY_SPECTRUM 512 + /// Spectrum: ∫ν1ν2Iν dν in each frequency channel in Scenery::screen_. #define GYOTO_QUANTITY_BINSPECTRUM 1024 -/* Astrobj-specific */ + /* Astrobj-specific */ + /// User1: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER1 32768 + /// User2: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER2 16384 + /// User3: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER3 8192 + /// User4: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER4 4096 + /// User5: Gyoto::Astrobj specific Gyoto::Quantity_t #define GYOTO_QUANTITY_USER5 2048 + //\} /** - * \brief Verbosity levels + * \name Gyoto messages + * \brief Controling which messages are shown to the user + * + * The user should be able to choose which messages are shown to + * her. In Gyoto, this is determined by a user-settable verbosity + * level (see Gyoto::verbose()) and a user-settable debug mode (see + * Goyto::debug()). + * + * The following macros define various debug and verbosity level and + * provide short-cuts to display formatted messages only at a given + * verbosity level or in debug mode. */ + //\{ + /// Type for verbosity levels typedef unsigned int Verbosity_t; + + /// Default debug mode #define GYOTO_DEFAULT_DEBUG_MODE 0 + + /// Quiet Gyoto::Verbosity_t + /** + * Only very few messages may be output to stdout at this level. + * + * Use #GYOTO_QUIET to display messages at this level. + */ #define GYOTO_QUIET_VERBOSITY 1 + + /// Severe warnings + /** + * Severe warning messages are output to stderr if + * Gyoto::verbose()≥GYOTO_SEVERE_VERBOSITY. + * + * Use #GYOTO_SEVERE to display messages at this level. + */ #define GYOTO_SEVERE_VERBOSITY 3 + + /// Warnings + /** + * Warning messages are output to stderr if + * Gyoto::verbose()≥GYOTO_WARNING_VERBOSITY. + * + * Use #GYOTO_WARNING to display messages at this level. + */ +#define GYOTO_WARNING_VERBOSITY GYOTO_SEVERE_VERBOSITY + + /// Default verbosity level + /** + * Normal messages are output to stdout if + * Gyoto::verbose()≥GYOTO_DEFAULT_VERBOSITY. + * + * Use #GYOTO_MSG to display messages at this level. + */ #define GYOTO_DEFAULT_VERBOSITY 5 + + /// Informative messages + /** + * Informative messages are output to stderr if + * Gyoto::verbose()≥GYOTO_INFO_VERBOSITY. + * + * Use #GYOTO_INFO to display messages at this level. + */ #define GYOTO_INFO_VERBOSITY 10 + + /// Maximum verbosity level + /** + * In debug mode, all messages are displayed in addition to specific + * debug information. + * + * To display debug messages, check #GYOTO_DEBUG_MODE or use + * #GYOTO_DEBUG for instance. + */ #define GYOTO_DEBUG_VERBOSITY 3000 -#define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) cout -#define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY)cerr<<"SEVERE: " -#define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY)cerr<<"WARNING: " -#define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) cout -#define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) cerr<<"INFO: " -#define GYOTO_DEBUG if (Gyoto::debug()) cerr << "DEBUG: " \ - << __PRETTY_FUNCTION__ << ": " + /// Display a message to stdout even in quiet mode. + /** + * Only very few messages may be output to stdout at this + * level. This should be reserved to messages shown at most once in + * a run. + * + * \code + * GYOTO_QUIET << "Important message displayed once" << std::endl; + * \endcode + */ +#define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) std::cout + /// Display a severe level message to stderr. /** - * \brief Coordinate system kinds + * \code + * GYOTO_SEVERE << "Important warning" << std::endl; + * \endcode + */ +#define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"SEVERE: " + + /// Display a warning level message to stderr. + /** + * \code + * GYOTO_WARNING << "Warning" << std::endl; + * \endcode + */ +#define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"WARNING: " + + /// Display normal message to stdout. + /** + * The message will by default be shown to the user. To be reserved + * to messages shown at most once per Gyoto::Screen row. + * + * \code + * GYOTO_MSG << "Message" << std::endl; + * \endcode + */ +#define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) std::cout + + /// Display informative message to stderr. + /** + * Message will be shown to the user only if Gyoto::verbose() has + * been explicitely raised. + * + * \code + * GYOTO_MSG << "Message" << std::endl; + * \endcode + */ +#define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) std::cerr<<"INFO: " + + /// Unit ignored because libudunits2 was disabled. + /** + * Use this warning when a conversion has been dropped due to + * #HAVE_UDUNITS being undefined. + * + * \param from From unit. + * \param to To unit. + */ +#define GYOTO_WARNING_UDUNITS(from, to) \ + GYOTO_WARNING << "unit ignored (trying to convert from \"" << from \ + << "\" to " \ + << to \ + << "\"), you may have more chance recompiling Gyoto with --with-udunits\n" + + /// Output expression value in debug mode + /** + * Output, only in debug mode both code and value that code + * yield. For instance: + * \code + * int a=1, b=2; + * GYOTO_DEBUG_EXPR(a+b); + * \endcode + * will essentially output, only in debug mode: + * \code + * DEBUG: : a+b=3 + * \endcode + */ +#define GYOTO_DEBUG_EXPR(a) GYOTO_DEBUG << #a << "=" << a << std::endl + + /// Output array content in debug mode + /** + * Output, only in debug, name and content of array. + * For instance: + * \code + * int a[]= {1, 2, 3}; + * GYOTO_DEBUG_ARRAY(a,3); + * \endcode + * will essentially output, only in debug mode: + * \code + * DEBUG: : a=[1,2,3] + * \endcode + * + * \param a Array + * \param n Number of elements to show (array must be at least this + * size). + */ +#define GYOTO_DEBUG_ARRAY(a,n) if (GYOTO_DEBUG_MODE) { \ + std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " \ + << #a << "=[" << a[0] ; \ + for (size_t _gyoto_debug_array_i=1; _gyoto_debug_array_i < n; ++_gyoto_debug_array_i) \ + std::cerr << "," << a[_gyoto_debug_array_i] ; \ + std::cerr << "]" << std::endl ;} + + /// Display debug message + /** + * Message is deiplayed only if #GYOTO_DEBUG_MODE is true and is + * prepended with the word "DEBUG:" and the signature of the + * function. + * + * \code + * GYOTO_DEBUG << "message" << endl; + * \endcode + */ +#define GYOTO_DEBUG if (GYOTO_DEBUG_MODE) std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " + + /// Start debug-only block. + /** + * Code between GYOTO_IF_DEBUG and #GYOTO_ENDIF_DEBUG is only + * executed in debug mode. + */ +#define GYOTO_IF_DEBUG if (GYOTO_DEBUG_MODE) { + + /// End debug-only block. + /** + * Code between #GYOTO_IF_DEBUG and GYOTO_ENDIF_DEBUG is only + * executed in debug mode. + */ +#define GYOTO_ENDIF_DEBUG } + + /// Whether debug mode is activated (run-time). +#define GYOTO_DEBUG_MODE Gyoto::debug() + + //\} + //\{ + /** + * \name Coordinate system kind * GYOTO_COORDKIND_CARTESIAN or GYOTO_COORDKIND_SPHERICAL + * + * Every Gyoto::Metric has a coordinate system kind. It can be used + * by functions which need to express coordinates always in + * spherical or always in Cartesian form, with trivial conversion + * between the two. + */ + /** + * \brief Type for coordinate system kinds */ typedef unsigned int CoordKind_t; #define GYOTO_COORDKIND_UNSPECIFIED 0 ///< Unspecified coordinate kind #define GYOTO_COORDKIND_CARTESIAN 1 ///< Cartesian-like coordinate system #define GYOTO_COORDKIND_SPHERICAL 2 ///< Spherical-like coordinate system - + //\} } -/* Default values for various things */ +//{ +/** + * \name Default values for various things + */ #define GYOTO_DEFAULT_X_SIZE 1024 ///< Default size for arrays in a Worldline - /** - * Default value for the initial step in the integration loop. Since - * the step is (most of the time) adaptive, this default only has - * little influence, but sometimes, it matters. Also used in Scenery. + * \brief Default value for the initial step in the integration loop. + * + * Since the step is (most of the time) adaptive, this default only + * has little influence, but sometimes, it matters. Also used in + * Scenery. */ #define GYOTO_DEFAULT_DELTA 0.01 /** - * Precision on the determination of a date (e.g. in - * Photon::findMin(), Photon::findValue()). + * \brief Default value for Gyoto::Worldline::maxiter_ + */ +#define GYOTO_DEFAULT_MAXITER 100000 + +/** + * \brief Precision on the determination of a date + * + * E.g. in Gyoto::Photon::findMin(), Gyoto::Photon::findValue(). */ #define GYOTO_T_TOL 1e-4 + +/// \brief Default value for Screen::dmax_ +#define GYOTO_SCREEN_DMAX 1e7 + +//For displays with setw and setprecision +/// Precision when outputting double values +#define GYOTO_PREC 15 +/// \brief Field width when outputting double values +#define GYOTO_WIDTH 25 + /* Plugins Stuff */ +/// \brief Default list of default plug-ins to load... #ifndef GYOTO_DEFAULT_PLUGINS #define GYOTO_DEFAULT_PLUGINS "stdplug,nofail:lorene" #endif #ifndef GYOTO_PLUGIN_SFX -#ifdef __APPLE__ -#define GYOTO_PLUGIN_SFX "dylib" -#else #define GYOTO_PLUGIN_SFX "so" #endif -#endif -/* Physical constants */ +//\} +//\{ +/** + *\name Physical constants + */ /// \brief Celerity of light (m/s) #define GYOTO_C 299792458. /// \brief Celerity of light (cm/s) #define GYOTO_C_CGS 2.99792458e10 -/// \Brief Gravitational constant (SI = m^3 * kg^-1 * s-2) +/// \brief Gravitational constant (SI = m^3 * kg^-1 * s-2) #define GYOTO_G 6.67428e-11 -/// \Brief Gravitational constant (cgs: cm^3 * g^-1 * s-2) +/// \brief Gravitational constant (cgs: cm^3 * g^-1 * s-2) #define GYOTO_G_CGS 6.67428e-8 /// \brief G/c^2=6.67428e-11/299792458.^2 #define GYOTO_G_OVER_C_SQUARE 7.426138e-28 /// \brief Planck's constant (h) in SI (J.s=kg.m^2/s) #define GYOTO_PLANCK 6.62606896e-34 +/// \brief Planck's constant (h) in c.g.s (g.cm^2/s) #define GYOTO_PLANCK_CGS 6.62606896e-27 /// \brief h/c^2 in SI (kg.s) #define GYOTO_PLANCK_OVER_C_SQUARE 7.372496e-51 @@ -199,8 +433,8 @@ #define GYOTO_EULER_MASCHERONI 0.577216 /// \brief atomic mass unit in cgs #define GYOTO_ATOMIC_MASS_UNIT_CGS 1.660537781e-24 - - +/// \brief Factor to convert Iν from c.g.s. to SI +#define GYOTO_INU_CGS_TO_SI 0.001 /// \brief Sun mass (kg) #define GYOTO_SUN_MASS 1.98843e30 @@ -217,17 +451,20 @@ /// \brief Convert from radians to degrees #define GYOTO_RADEG 57.2957795130823 +/// \brief Convert from degrees to radians #define GYOTO_DEGRAD 0.0174532925199433 +/// \brief Convert from arcminutes to radians #define GYOTO_MINRAD 2.908882086657216e-04 +/// \brief Convert from arcseconds to radians #define GYOTO_SECRAD 4.848136811095360e-06 +/// \brief Convert from milliarcseconds to radians #define GYOTO_MASRAD 4.848136811095360e-09 +/// \brief Convert from microarcseconds to radians #define GYOTO_MUASRAD 4.848136811095360e-12 -/// \brief Default value for Screen::dmax_ -#define GYOTO_SCREEN_DMAX 1e7 +/// \brief Convert from eV to Hz +#define GYOTO_eV2Hz 2.417989348e+14 -//For displays with setw and setprecision -#define GYOTO_PREC 15 -#define GYOTO_WIDTH 25 +//\} #endif diff -Nru gyoto-0.0.3/include/GyotoDisk3D.h gyoto-0.1.0/include/GyotoDisk3D.h --- gyoto-0.0.3/include/GyotoDisk3D.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoDisk3D.h 2013-07-27 09:14:20.000000000 +0000 @@ -49,127 +49,204 @@ * treatment is provided in heir classes. * * The 3D disk is assumed to be described by a regular - * (non adaptive) grid. + * (non adaptive) grid of cylindrical geometry. The disk + * is a slab from rin_ to rout_ and zmin_ (typically = -zmax_) to zmax_. * */ class Gyoto::Astrobj::Disk3D : public Gyoto::Astrobj::Generic { friend class Gyoto::SmartPointer; private: - std::string filename_; + std::string filename_; ///< Optional FITS file name containing the arrays /** * An array of dimensionality double[nr_][nz_][nphi_][nnu_]. In FITS * format, the first dimension is nu, the second phi, the third * z and last r. It typically contains temperature and is used only by * subclasses. */ - double * emissquant_; ///< Inu(nu, r, z, phi) + double * emissquant_; ///< Physical quantity yielding emission. /** * An array of dimensionality double[nr_][nz_][nphi_][3]. In FITS format, * the second dimension is phi, the third z and last r. The first plane in * the first FITS dimention is dphi/dt, the second dz/dt the last dr/dt. */ - double * velocity_; ///< velocity(r, z, phi) + double * velocity_; ///< Velocity(r, z, phi) - double dnu_; - double nu0_; - size_t nnu_; - - double dphi_; - double phimin_; - size_t nphi_; - double phimax_; + double dnu_; ///< Frequency scale of PatternDisk::emission_ in Hz + double nu0_; ///< Lowest frequency provided in PatternDisk::emission_ in Hz + size_t nnu_; ///< Number of frequencies provided in PatternDisk::emission_ + + double dphi_; ///< δφ between two grid columns + double phimin_;///< Minimum φ in grid + size_t nphi_; ///< Grid size in the φ direction + double phimax_; ///< Maximum φ in grid /** * XML elment: <RepeatPhi>. * FITS keyword: HIERARCH GYOTO Disk3D RepeatPhi */ - size_t repeat_phi_; + size_t repeat_phi_; ///< Number of times the pattern should be repeated to cover [0, 2Π] //double phi0_==0, phi max is always 2*M_PI - double dz_; - double zmin_; - size_t nz_; - double zmax_; - - double dr_; - double rin_; - size_t nr_; - double rout_; + double dz_; ///< Altitude step + double zmin_; ///< Minimum altitude + size_t nz_; ///< Grid size in the altitude direction + double zmax_; ///< Maximum altitude + + double dr_; ///< Radius step + double rin_; ///< Inner radius of the grid + size_t nr_; ///< Number of rows in the patternGrid size in the r direction + double rout_; ///< Outer radius of the grid // Constructors - Destructor // ------------------------- public: - Disk3D(); ///< Standard constructor + Disk3D(); ///< Standard constructor. - Disk3D(const Disk3D& ) ;///< Copy constructor - virtual Disk3D* clone () const; ///< Cloner + Disk3D(const Disk3D& ) ;///< Copy constructor. + virtual Disk3D* clone () const; ///< Cloner. - virtual ~Disk3D() ; ///< Destructor + virtual ~Disk3D() ; ///< Destructor. // Accessors // --------- public: - // virtual void setInnerRadius(double); ///< Set rin_ - // virtual void setOuterRadius(double); ///< Set rout_ + /// Read parameters and arrays from FITS file. virtual void fitsRead(std::string filename_); + + /// Write parameters and arrays to FITS file. virtual void fitsWrite(std::string filename_); - ///< Read data from file + /// Set Disk3D::emissquant_. + /** + * The pointer is copied directly, not the array content. + * + * This is a low-level function. Beware that: + * - previously allocated array will not be freed automatically; + * - array attached when the destructor is called will be freed. + */ void setEmissquant(double * pattern); + + /// Set Disk3D::velocity__. + /** + * The pointer is copied directly, not the array content. + * + * This is a low-level function. Beware that: + * - previously allocated array will not be freed automatically; + * - array attached when the destructor is called will be freed. + */ void setVelocity(double * pattern); + + /// Set Disk3D::emissquant_. /** - * \param pattern: new emission_ array. - * \param dims[4] = { nnu_, nphi_, nz_, nr_ }; + * Disk3D::emissquant_ is freed if not NULL, reallocated, and + * pattern is copied into emission_. + * + * If Disk3D::velocity_ or has been set previously with mismatching + * sizes, it is deallocated too. + * + * Finally, Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_ and + * Disk3D::nr_ are set according to naxes. + * + * \param pattern Array to copy as emission_. May be NULL in which + * case emission_ is simply deallocated and set to NULL. + * + * \param naxes { nnu_, nphi_, nz_, nr_ }. */ virtual void copyEmissquant(double const * const pattern = NULL, size_t const naxes[4] = NULL); - ///< attach emissquant_ array and set its size - virtual double const * const getEmissquant() const; + + /// Get Disk3D::emissquant_. + virtual double const * getEmissquant() const; + + /// Get { Disk3D::nnu_, Disk3D::nphi_, Disk3D::nz_, Disk3D::nr_ }. virtual void getEmissquantNaxes( size_t naxes[4] ) const ; + /// Set Disk3D::velocity_. + /** + * Disk3D::velocity_ is first freed if not NULL and set to NULL. + * + * If pattern is not NULL, Disk3D::emissquant_ must have been set + * previously with matching dimensions. Disk3D::velocity_ is + * then reallocated, and pattern is copied into velocity_. + * + * \param pattern Array to copy as velocity_. May be NULL in which + * case velocity_ is simply deallocated and set to NULL. + * + * \param naxes { nphi_, nz_, nr_ }. + */ virtual void copyVelocity(double const * const pattern = NULL, size_t const naxes[3] = NULL); - virtual double const * const getVelocity() const; + /// Get Disk3D::velocity_. + virtual double const * getVelocity() const; + /// Set Disk3D::repeat_phi_. virtual void repeatPhi(size_t n); + /// Get Disk3D::repeat_phi_. virtual size_t repeatPhi() const; + /// Set Disk3D::nu0_. virtual void nu0(double freq); + /// Get Disk3D::nu0_. virtual double nu0() const; + /// Set Disk3D::dnu_. virtual void dnu(double dfreq); + /// Get Disk3D::dnu_. virtual double dnu() const; + /// Set Disk3D::rin_. void rin(double rrin); + /// Get Disk3D::rin_. double rin() const; + /// Set Disk3D::rout_. void rout(double rout); + /// Get Disk3D::rout_. double rout() const; + /// Set Disk3D::zmin_. void zmin(double zmin); + /// Get Disk3D::zmin_. double zmin() const; + /// Set Disk3D::zmax_. void zmax(double zmax); + /// Get Disk3D::zmax_. double zmax() const; + /// Set Disk3D::phimin_. void phimin(double phimin); + /// Get Disk3D::phimin_. double phimin() const; + /// Set Disk3D::phimax_. void phimax(double phimax); + /// Get Disk3D::phimax_. double phimax() const; - virtual int setParameter(std::string name, std::string content); + virtual int setParameter(std::string name, + std::string content, + std::string unit); protected: void getIndices(size_t i[4], double const co[4], double nu=0.) const ; - ///< get emission_ cell corresponding to position co[4] + ///< Get emissquant_ cell corresponding to position co[4]. public: int Impact(Photon *ph, size_t index, Astrobj::Properties *data); + + /// Get fluid 4-velocity at point. + /** + * Fill vel with the 4-vector velocity of the fluid at 4-position + * pos. + * + * \param[in] pos 4-position at which to compute velocity; + * \param[out] vel 4-velocity at pos. + */ virtual void getVelocity(double const pos[4], double vel[4]) ; public: diff -Nru gyoto-0.0.3/include/GyotoDisk3D_BB.h gyoto-0.1.0/include/GyotoDisk3D_BB.h --- gyoto-0.0.3/include/GyotoDisk3D_BB.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoDisk3D_BB.h 2013-07-27 09:14:20.000000000 +0000 @@ -96,19 +96,36 @@ public: void setMetric(SmartPointer gg); - virtual int setParameter(std::string name, std::string content); + virtual int setParameter(std::string name, + std::string content, + std::string unit); + /// Compute emission at one grid date. double emission1date(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; + using Disk3D::emission; + /// Interpolate emission between grid dates. virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; + /// Compute transmission at one grid date. + double transmission1date(double nu_em, double dsem, + double c_ph[8], double c_obj[8]) const; + + /// Interpolate transmission between grid dates. + double transmission(double nu_em, double dsem, + double c_obj[8]) const; + void getVelocity(double const pos[4], double vel[4]); - double const * const getVelocity() const; + double const * getVelocity() const; protected: + /// Set underlying Disk3D pointers to a specific date slice. + /** + * \param iq Index of the date slice. + */ void copyQuantities(int iq) ; public: diff -Nru gyoto-0.0.3/include/GyotoDynamicalDisk.h gyoto-0.1.0/include/GyotoDynamicalDisk.h --- gyoto-0.0.3/include/GyotoDynamicalDisk.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoDynamicalDisk.h 2013-07-27 09:14:20.000000000 +0000 @@ -51,41 +51,44 @@ friend class Gyoto::SmartPointer; private: char* dirname_; ///< FITS files directory - double tinit_; ///< Time of the first FITS file + double tinit_; ///< date of the first FITS file double dt_; ///< Time increment between two FITS (assumed constant) - int nb_times_; ///< Number of times + int nb_times_; ///< Number of dates - /** - * An array of dimensionality double[nr_][nphi_][nnu_]. In FITS - * format, the first dimension is nu, the second phi, and the third - * r. - */ + /// Array of PatternDisk::emission_ arrays double ** emission_array_; - double ** opacity_array_; ///< same dimenstions as emission, or NULL + /// Array of PatternDisk::opacity_ arrays + double ** opacity_array_; - /** - * An array of dimensionality double[nr_][nphi_][2]. In FITS format, - * the second dimension is phi, and the third r. The first plane in - * the first FITS dimention is dphi/dt, the second dr/dt. - */ - double ** velocity_array_; ///< velocity(, r, phi) + /// Array of PatternDisk::velocity_ arrays + double ** velocity_array_; ///< - /** - * In case of adaptive grid. - */ + /// Array of PatternDisk::radius_ arrays double ** radius_array_; ///< radius vector + /// Array of PatternDisk::dnu_ values double * dnu_array_; + + /// Array of PatternDisk::nu0_ values double * nu0_array_; + + /// Array of PatternDisk::nu1_ values size_t * nnu_array_; + + /// Array of PatternDisk::dphi_ values double * dphi_array_; + + /// Array of PatternDisk::nphi_ values size_t * nphi_array_; + + /// Array of PatternDisk::dr_ values double * dr_array_; + + /// Array of PatternDisk::nr_ values size_t * nr_array_; - // double r0_; // this is rin_ // Constructors - Destructor // ------------------------- @@ -101,16 +104,23 @@ // --------- public: - virtual int setParameter(std::string name, std::string content); + virtual int setParameter(std::string name, + std::string content, + std::string unit); + using PatternDiskBB::emission; virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; void getVelocity(double const pos[4], double vel[4]); - double const * const getVelocity() const; + double const * getVelocity() const; protected: + /// Set underlying PatternDisk pointers to a specific date slice. + /** + * \param iq Index of the date slice. + */ void copyQuantities(int iq) ; public: diff -Nru gyoto-0.0.3/include/GyotoError.h gyoto-0.1.0/include/GyotoError.h --- gyoto-0.0.3/include/GyotoError.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoError.h 2013-07-27 09:14:20.000000000 +0000 @@ -2,12 +2,23 @@ * \file GyotoError.h * \brief Error handling * - * Every Gyoto method should check for possible error conditions and - * throw adequate Gyoto::Error exceptions. For instance: + * Gyoto dlopens its plug-ins. The throw/catch C++ mechanism cannot + * pass the dlopen boundary. The Gyoto::Error mechanism alleviates + * this C++ language limitation. + * + * Every Gyoto method (either in the main Gyoto library or in a Gyoto + * plug-in) should check for possible error conditions and throw + * adequate Gyoto::Error exceptions through the + * Gyoto::Error::throw() function. For instance: * \code - * if (error_condition) throw Gyoto::Error("Useful error message"); + * if (error_condition) Gyoto::Error::throw("Useful error message"); * \endcode * + * If the main code has set Gyoto::Error::handler_t error handler + * using Gyoto::Error::setHandler(), these errors will then be passed + * to it. Else, the Error is C++-thrown at the main Gyoto library + * level, above the dlopen boundary. + * * The main code can then catch these exceptions and act appropriately, * for instance: * \code @@ -21,7 +32,7 @@ * */ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -57,64 +68,121 @@ * \class Gyoto::Error * \brief Class for thowing exceptions. * - * Every Gyoto method should check for possible error conditions and - * throw adequate Gyoto::Error exceptions. For instance: + * Gyoto dlopens its plug-ins. The throw/catch C++ mechanism cannot + * pass the dlopen boundary. The Gyoto::Error mechanism alleviates + * this C++ language limitation. + * + * Every Gyoto method (either in the main Gyoto library or in a Gyoto + * plug-in) should check for possible error conditions and throw + * adequate Gyoto::Error exceptions through the + * Gyoto::throwError() function. For instance: * \code - * if (error_condition) throw Gyoto::Error("Useful error message"); + * if (error_condition) Gyoto::throwError("Useful error message"); * \endcode + * + * If the main code has set Gyoto::Error::handler_t error handler + * using Gyoto::Error::setHandler(), these errors will then be passed + * to it. Else, the Error is C++-thrown at the main Gyoto library + * level, above the dlopen boundary. + * + * The main code can then catch these exceptions and act appropriately, + * for instance: + * \code + * try { gyoto_code ; } + * catch (Gyoto::Error err) + * { + * err.Report(); + * abort(); + * } + * \endcode */ class Gyoto::Error { private: - //const char* message; /*!< error message */ - const std::string message; /*!< error message */ - const int errcode; - public: + /// Error message. + const std::string message; + /// Error code. /** - * \brief Constructor with an error message - * \param m : pointer (char*) to the error message + * Default value is EXIT_FAILURE from cstdlib. Currently not used in + * practice. */ - //Error( const char* m ); + const int errcode; + + public: + + /// Constructor with an error message. Error( const std::string m ); - /** - * \brief Constructor with an error code - * \param int errcode : error code - */ + /// Constructor with an error code. Error( const int errcode ); + /// Constructor with both an error message and an error code. + Error( const std::string m, const int errcode ); - /** - * \brief Constructor with both an error message and an error code - * \param m : pointer (char*) to the error message - * \param int errcode : error code - */ - Error( const char* m , const int errcode ); + /// Print-out error message on standard error. + void Report() const ; + /// Retrieve error code. /** - * \brief Print-out error message on standard error + * See also operator const char * () const and get_message(). + * \return Error code */ - void Report() const ; /*!< */ + int getErrcode() const ; + /// Cast to const char *. /** - * \brief Retrieve error code - * \return Error code + * Retrieve error message as a C string. See also get_message() and + * gerErrcode(). */ - int getErrcode() const ; + operator const char * () const; + /// Retrieve error message for custom handling of the exception. /** - * \brief Retrieve error message for custom handling of the exception + * See also operator const char * () const and getErrCode(). * \return char* message : pointer to the error message */ - //char const * const get_message() const ; std::string get_message() const ; -}; -typedef void GyotoErrorHandler_t (const char*); + /// Error handler type. + /** + * Instead of catching Gyoto errors directly (for instance if gyoto + * itself is dlopened), you can set a Handler_t error handler using + * setHandler(). + * + * A very simple handler could be: + * \code + * void applicationErrorHandler(const Gyoto::Error e) { + * e.Report(); + * exit ( e.getErrCode() ); + * } + * \endcode + */ + typedef void Handler_t (const Error); + + /// Set application error handler. + /** + * Instead of catching Gyoto errors directly (for instance if gyoto + * itself is dlopened), you can set an Error::Handler_t error + * handler using setHandler(). + * + * \code + * void applicationErrorHandler(const Gyoto::Error e) { + * e.Report(); + * exit ( e.getErrCode() ); + * } + * int main() { + * Gyoto::Error::setHandler(&applicationErrorHandler); + * } + * \endcode + * \param phandler Function pointer to the handler. + */ + static void setHandler( Gyoto::Error::Handler_t* phandler); + +}; namespace Gyoto { - void setErrorHandler( GyotoErrorHandler_t* ); + /// Throw a Gyoto::Error void throwError( std::string ); } diff -Nru gyoto-0.0.3/include/GyotoFactory.h gyoto-0.1.0/include/GyotoFactory.h --- gyoto-0.0.3/include/GyotoFactory.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoFactory.h 2013-07-27 09:14:20.000000000 +0000 @@ -4,7 +4,7 @@ * \file GyotoFactory.h * \brief XML I/O * - * The Factory is a place where objects are built + * The Factory is a place where objects are built. * */ /* @@ -29,6 +29,13 @@ #ifndef __GyotoFactory_H_ #define __GyotoFactory_H_ +#include "GyotoConfig.h" + +/// Xerces internal. +/** + * For some reason it sometimes need to be set to 0 instead of being + * undefined. + */ #ifndef XERCES_INCLUDE_WCHAR_H #define XERCES_INCLUDE_WCHAR_H 0 #endif @@ -45,7 +52,10 @@ namespace Gyoto { class Factory; class FactoryMessenger; - class Spectrometer; + namespace Spectrometer { + class Generic; + class Uniform; + } } /** @@ -64,34 +74,39 @@ * with a filename, and get whichever object type you are interested * in: * \code -Gyoto::Factory * factory = new Gyoto::Factory("some/input/file.xml"); -const std::string kind = factory->getKind(); -if (kind.compare("Scenery")) Gyoto::throwError("I wan't a Scenery"); -Gyoto::SmartPointer scenery = factory -> getScenery(); -Gyoto::SmartPointer screen = scenery->getScreen(); -Gyoto::SmartPointer object = scenery->getAstrobj(); -Gyoto::SmartPointer object = scenery->getMetric(); -delete factory; factory=NULL; + * Gyoto::Factory * factory = new Gyoto::Factory("some/input/file.xml"); + * const std::string kind = factory->getKind(); + * if (kind.compare("Scenery")) Gyoto::throwError("I wan't a Scenery"); + * Gyoto::SmartPointer scenery = factory -> getScenery(); + * Gyoto::SmartPointer screen = scenery->getScreen(); + * Gyoto::SmartPointer object = scenery->getAstrobj(); + * Gyoto::SmartPointer metric = scenery->getMetric(); + * delete factory; factory=NULL; * \endcode or, for a single object and without checking the kind * (getKind()) first: -\code -Gyoto::SmartPointer scenery = Factory("some/input/file.xml").getScenery(); -\endcode + * \code + * Gyoto::SmartPointer scenery = Factory("some/input/file.xml").getScenery(); + * \endcode * * - * Writing an object to a fie is even easier. Assuming "object" below + * Writing an object to a file is even easier. Assuming "object" below * is a Gyoto::SmartPointer where "class" is one of Scenery, * Metric::Generic, Astrobj::Generic, Spectrum::Generic, Screen, * Photon or Spectrometer: * \code -Gyoto::Factory * factory = new Gyoto::Factory(object); -factory -> write("some/output/file.xml"); -delete factory; factory=NULL; + * Gyoto::Factory * factory = new Gyoto::Factory(object); + * factory -> write("some/output/file.xml"); + * delete factory; factory=NULL; * \endcode * * or, for short: * \code -Gyoto::Factory(object).write("some/output/file.xml"); + * Gyoto::Factory(object).write("some/output/file.xml"); + * \endcode + * + * You can also directly display the object to stdout: + * \code + * std::cout << Gyoto::Factory(object).format() << std::endl; * \endcode */ class Gyoto::Factory @@ -100,87 +115,279 @@ protected: // XERCES MACHINERY + /// Xerces error handler xercesc::ErrorHandler *reporter_; + /// The document being read or written xercesc::DOMDocument *doc_; + /// Root element in Factory::doc_ xercesc::DOMElement *root_; + /// Xerces parser xercesc::XercesDOMParser *parser_; + /// Xerces resolver xercesc::DOMXPathNSResolver* resolver_; + /// Xerces implementation xercesc::DOMImplementation* impl_; // Elements which must happen only once in a file // but may happen about anywhere + /// XML element representing the Metric xercesc::DOMElement *gg_el_; + /// XML element representing the Astrobj xercesc::DOMElement *obj_el_; + /// XML element representing the Photon xercesc::DOMElement *ph_el_; // GYOTO elements + /// The Scenery read from or written to Factory::doc_ SmartPointer scenery_; + /// The Metric read from or written to Factory::doc_ SmartPointer gg_; + /// The Screen read from or written to Factory::doc_ SmartPointer screen_; + /// The Astrobj read from or written to Factory::doc_ SmartPointer obj_; + /// The Photon read from or written to Factory::doc_ SmartPointer photon_; - SmartPointer spectro_; + /// The Spectrometer read from or written to Factory::doc_ + SmartPointer spectro_; // Factory stuff + /// XML file name, if actually reading from or writting to file. std::string filename_; + /// Kind of root element (Scenery, Metric etc.) std::string kind_; public: - // Constructor for READING + /// Constructor for reading a file Factory(char * filename); - // Constructors for SAVING + /// Constructor for saving (or printing) a Scenery Factory(SmartPointer sc); + /// Constructor for saving (or printing) a Metric Factory(SmartPointer gg); + /// Constructor for saving (or printing) an Astrobj Factory(SmartPointer ao); + /// Constructor for saving (or printing) a Spectrum Factory(SmartPointer sp); + /// Constructor for saving (or printing) a Screen Factory(SmartPointer screen); + /// Constructor for saving (or printing) a Photon Factory(SmartPointer photon); - Factory(SmartPointer Spectrometer); + /// Constructor for saving (or printing) a Spectrometer + Factory(SmartPointer Spectrometer); - // Destructor + /// Destructor ~Factory(); private: - // Internal stuff + /// Set Xerces reporter void setReporter(xercesc::ErrorHandler*); + /// Get Factory::root_ xercesc::DOMElement * getRoot(); + /// Get Factory::doc_ xercesc::DOMDocument* getDoc(); public: + /// Get Factory::kind_ const std::string getKind(); - ///< Name of TOP-LEVEL object (Scenery, Metric, Astrobj...) - // Building and getting SmartPointer + /// Find Scenery element, instanciate it and get it. + /** + * Scenery must be the root element. getScenery() will call + * getMetric(), getAstrobj() and getScreen(). + */ Gyoto::SmartPointer getScenery(); + + /// Find Metric element, instanciate it and get it. + /** + * Metric may be either the root element or directly within the root + * element. + */ Gyoto::SmartPointer getMetric(); + + /// Find Screen element, instanciate it and get it. + /** + * Screen may be either the root element or directly within the root + * element. + */ Gyoto::SmartPointer getScreen(); + + /// Find Astrobj element, instanciate it and get it. + /** + * Astrobj may be either the root element or directly within the root + * element. + */ Gyoto::SmartPointer getAstrobj(); + + /// Find Photon element, instanciate it and get it. + /** + * Photon may be either the root element or directly within the root + * element. + */ Gyoto::SmartPointer getPhoton(); + + /// Find Photon element, instanciate it and get it. + /** + * Photon may be either the root element or directly within the root + * element. + */ Gyoto::SmartPointer getSpectrum(); - Gyoto::SmartPointer getAstrobjProperties(); + + /// Find Spectrometer element, instanciate it and get it. + /** + * Spectrometer may be either the root element or directly within the root + * element. + */ + Gyoto::SmartPointer getSpectrometer(); // XML OUTPUT + /// Write constructed XML representation to file void write(const char* const fname=0); + + /// Get constructed XML representation as std::string std::string format(); // Setting elements + /// Set Metric for this document. + /** + * If called several times for the same document, the metric + * SmartPointers must point to the same instance or an error will be + * thrown using Gyoto::throwError(). + */ void setMetric(SmartPointer gg, xercesc::DOMElement *el); + + /// Set Astrobj for this document. + /** + * If called several times for the same document, the astrobj + * SmartPointers must point to the same instance or an error will be + * thrown using Gyoto::throwError(). + */ void setAstrobj(SmartPointer ao, xercesc::DOMElement *el); + + /// Set Screen for this document. + /** + * If called several times for the same document, the screen + * SmartPointers must point to the same instance or an error will be + * thrown using Gyoto::throwError(). + */ void setScreen(SmartPointer scr, xercesc::DOMElement *el); + + /// Set text content of XML element void setContent(std::string content, xercesc::DOMElement *el); + + /// Create new XML element without content + /** + * E.g. + * \code + * + * \endcode + * \param name XML entity name. + * \param pel Parent XML element. + */ void setParameter(std::string name, xercesc::DOMElement *pel); - void setParameter(std::string name, double value, xercesc::DOMElement *pel); - void setParameter(std::string name, int value, xercesc::DOMElement *pel); - void setParameter(std::string name, unsigned int value, xercesc::DOMElement *pel); - void setParameter(std::string name, long value, xercesc::DOMElement *pel); - void setParameter(std::string name, unsigned long value, xercesc::DOMElement *pel); - void setParameter(std::string name, std::string sval, xercesc::DOMElement*); - void setParameter(std::string , double val[], size_t, xercesc::DOMElement*, + + /// Create new XML element with double value + /** + * E.g. + * \code + * 2. + * \endcode + * \param name XML entity name. + * \param value Entity content. + * \param pel Parent XML element. + */ + void setParameter(std::string name, double value, + xercesc::DOMElement *pel); + + /// Create new XML element with integer value + /** + * E.g. + * \code + * 7 + * \endcode + * \param name XML entity name. + * \param value Entity content. + * \param pel Parent XML element. + */ + void setParameter(std::string name, int value, + xercesc::DOMElement *pel); + + /// Create new XML element with integer value + /** + * E.g. + * \code + * 7 + * \endcode + * \param name XML entity name. + * \param value Entity content. + * \param pel Parent XML element. + */ + void setParameter(std::string name, unsigned int value, + xercesc::DOMElement *pel); + + /// Create new XML element with integer value + /** + * E.g. + * \code + * 7 + * \endcode + * \param name XML entity name. + * \param value Entity content. + * \param pel Parent XML element. + */ + void setParameter(std::string name, long value, + xercesc::DOMElement *pel); + + /// Create new XML element with integer value + /** + * E.g. + * \code + * 7 + * \endcode + * \param name XML entity name. + * \param value Entity content. + * \param pel Parent XML element. + */ + void setParameter(std::string name, unsigned long value, + xercesc::DOMElement *pel); + + /// Create new XML element with string content + /** + * E.g. + * \code + * Text + * \endcode + * + * Any parameter can acually be set this way if total control over + * Text formatting is wished for. + * \param name XML entity name. + * \param value Entity content. + * \param pel Parent XML element. + */ + void setParameter(std::string name, std::string value, + xercesc::DOMElement*pel); + + /// Create new XML element with array content + /** + * E.g. + * \code + * 0. 10. 3.14. 0. + * \endcode + * \param[in] name XML entity name. + * \param[in] val Entity content. + * \param[in] nelem Number of elements in val to output. + * \param[in] pel Parent XML element. + * \param[out] child If not NULL, set to a new Gyoto::FactoryMessenger + * pointing to the new element. It must be deleted later. + */ + void setParameter(std::string name, double val[], size_t nelem, + xercesc::DOMElement* pel, FactoryMessenger **child = NULL); + /// Transform relative path into absolute path. /** - * Input is path relative to XML file. Output is absolute path to same file. + * \param relpath Path relative to XML file. + * \return Absolute path to same file. */ std::string fullPath(std::string relpath); }; diff -Nru gyoto-0.0.3/include/GyotoFactoryMessenger.h gyoto-0.1.0/include/GyotoFactoryMessenger.h --- gyoto-0.0.3/include/GyotoFactoryMessenger.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoFactoryMessenger.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,3 +1,7 @@ +/** + * \file GyotoFactoryMessenger.h + * \brief Factory / SmartPointee::Subcontractor_t interface + */ #ifdef GYOTO_USE_XERCES /* Copyright 2011 Thibaut Paumard @@ -21,7 +25,11 @@ #ifndef __GyotoFactoryMessenger_H_ #define __GyotoFactoryMessenger_H_ - +/// Internal to Xerces +/** + * For obscure reasons, this needs to be set to 0 instead of just + * undefined. + */ #ifndef XERCES_INCLUDE_WCHAR_H #define XERCES_INCLUDE_WCHAR_H 0 #endif @@ -58,16 +66,16 @@ * implementation of BASE::Generic, the subcontractor static member * function often looks like this: * -\code -SmartPointer MyClass::Subcontractor(Gyoto::FactoryMessenger *messenger) { - SmartPointer deliverable = new MyClass(); - while (messenger->getNextParameter(name, content) { - if (name=="SomeProperty") deliverable -> setSomeProperty(content); - else if (name=="AnotherProperty") deliverable -> setAnotherProperty(content); - } - return deliverable; -} -\endcode + * \code + * SmartPointer MyClass::Subcontractor(Gyoto::FactoryMessenger *messenger) { + * SmartPointer deliverable = new MyClass(); + * while (messenger->getNextParameter(name, content) { + * if (name=="SomeProperty") deliverable -> setSomeProperty(content); + * else if (name=="AnotherProperty") deliverable -> setAnotherProperty(content); + * } + * return deliverable; + * } + * \endcode * * Other get* methods are provided to cope with more complex syntax * (e.g. when XML attributes are used, as in <ParameterName @@ -148,22 +156,25 @@ * children_. Usually, "name" is the name of a parameter and * "content" is the string representation of the corresponding * value. For instance: -\code -Content -\endcode + * \code + * Content + * \endcode * * \param name upon output, name of the child - * \param content content of the child + * \param content of the child + * \param unit= propertty of the child * \return 1 if there remains parameters to retrieve, 0 otherwise. */ - int getNextParameter(std::string* name, std::string* content); + int getNextParameter(std::string* name, + std::string* content, + std::string* unit=NULL); ///< Get name and value of next parameter /** * For instance a Spectrometer description looks like this -\code - 2.0e-6 2.4e-6 -\endcode + * \code + * 2.0e-6 2.4e-6 + * \endcode * and the Spectrometer builder uses getSelfAttribute() to retrieve * the attributes "kind" and "nsamples". * @@ -175,9 +186,9 @@ /** * For instance -\code -ParameterContent -\endcode + * \code + * ParameterContent + * \endcode * * \param attrname name of the attribute * \return attrvalue @@ -192,9 +203,9 @@ * FactoryMessenger::children_ . * * For instance a Spectrometer description looks like this: -\code - 2.0e-6 2.4e-6 -\endcode + * \code + * 2.0e-6 2.4e-6 + * \endcode * and the Spectrometer builder uses getFullContent() to retrieve * the spectral boundaries (2.0e-6 and 2.4e-6 here). */ @@ -206,17 +217,17 @@ * instance the complete description of a Gyoto::Spectrum), it is * possible to initialize a new FactoryMessenger and call the * correct subcontractor: -\code -SmartPointer spectrum = NULL; -while (messenger->getNextParameter(name, content) { - if (name=="Spectrum") { - content = messenger->getAttribute("kind"); - FactoryMessenger* child = messenger->getChild(); - deliverable->setSpectrum( (*Spectrum::getSubcontractor(content))(child) ); - delete child; - } -} -\endcode + * \code + * SmartPointer spectrum = NULL; + * while (messenger->getNextParameter(name, content) { + * if (name=="Spectrum") { + * content = messenger->getAttribute("kind"); + * FactoryMessenger* child = messenger->getChild(); + * deliverable->setSpectrum( (*Spectrum::getSubcontractor(content))(child) ); + * delete child; + * } + * } + * \endcode * The child is allocated with new and must be deleted after use. */ FactoryMessenger * getChild() const ; @@ -254,11 +265,11 @@ * * To make things clearer: Assume "scenery" is a fully filled * Scenery. scenery->fillElement(messenger) will call: -\code -messenger->setMetric(Scenery::gg_) -messenger->setScreen(Scenery::screen_) -messenger->setAstrobj(Scenery::obj_); -\endcode + * \code + * messenger->setMetric(Scenery::gg_) + * messenger->setScreen(Scenery::screen_) + * messenger->setAstrobj(Scenery::obj_); + * \endcode * * The Factory will then call screen_->fillElement(child_messenger) * and obj_->fillElement(child_messenger), each of which will also @@ -284,9 +295,9 @@ /** * Create child XML element of the form -\code - -\endcode + * \code + * + * \endcode * for instance when "name" is boolean (present or absent), or only * takes attributes (see FactoryMessenger::setAttribute()). As an * example, Astrobj::Generic::fillElement() uses @@ -298,9 +309,9 @@ /** * Convert value to striing "svalue" and create an XML child element * of the form -\code -svalue -\endcode + * \code + * svalue + * \endcode */ void setParameter(std::string name, double value); ///< Output parameter @@ -308,9 +319,9 @@ /** * Convert value to striing "svalue" and create an XML child element * of the form -\code -svalue -\endcode + * \code + * svalue + * \endcode */ void setParameter(std::string name, long int value); ///< Output parameter @@ -318,9 +329,9 @@ /** * Convert value to striing "svalue" and create an XML child element * of the form -\code -svalue -\endcode + * \code + * svalue + * \endcode */ void setParameter(std::string name, unsigned int value); ///< Output parameter @@ -328,42 +339,42 @@ /** * Convert value to striing "svalue" and create an XML child element * of the form -\code -svalue -\endcode + * \code + * svalue + * \endcode */ void setParameter(std::string name, unsigned long value); ///< Output parameter /** - * Convert value to striing "svalue" and create an XML child element + * Convert value to string "svalue" and create an XML child element * of the form -\code -svalue -\endcode + * \code + * svalue + * \endcode */ void setParameter(std::string name, int value); ///< Output parameter /** * Create an XML child element of the form -\code -value -\endcode + * \code + * value + * \endcode */ void setParameter(std::string name, std::string value); ///< Output parameter /** * For instance: -\code -double val[4] = {1., 2., 3., 4.}; -messenger->setParameter("MyArray", val, 4); -\endcode + * \code + * double val[4] = {1., 2., 3., 4.}; + * messenger->setParameter("MyArray", val, 4); + * \endcode * will result in something like this: -\code -1.000000 2.000000 3.000000 4.000000 -\endcode + * \code + * 1.000000 2.000000 3.000000 4.000000 + * \endcode * * The exact format is unspecified, determined at compile time, and * by default, unlike in the example above, outputs a large number @@ -385,13 +396,13 @@ /** * For instance Spectrometer::fillElement() sets its "kind" * attribute somewhat like this: -\code -messenger->setSelfAttribute("kind", "wave"); -\endcode + * \code + * messenger->setSelfAttribute("kind", "wave"); + * \endcode * to produce something like this: -\code - -\endcode + * \code + * + * \endcode */ void setSelfAttribute(std::string attrname, std::string value) ; ///< Set attribute in FactoryMessenger::element_ @@ -428,16 +439,16 @@ * To be used from fillElement() methods. For instance, the * Star::fillElement() method calls makeChild() to save the Star's * Spectrum and Opacity members somewhat like this: -\code -FactoryMessenger * child; -child = messenger-> makeChild("Spectrum"); -spectrum_ -> fillElement(child); -delete child; -child = messenger-> makeChild("Opacity"); -opacity_ -> fillElement(child); -delete child; -child=NULL; -\endcode + * \code + * FactoryMessenger * child; + * child = messenger-> makeChild("Spectrum"); + * spectrum_ -> fillElement(child); + * delete child; + * child = messenger-> makeChild("Opacity"); + * opacity_ -> fillElement(child); + * delete child; + * child=NULL; + * \endcode * * The child messenger is allocated with new, you need to delete it * after use. diff -Nru gyoto-0.0.3/include/GyotoFixedStar.h gyoto-0.1.0/include/GyotoFixedStar.h --- gyoto-0.0.3/include/GyotoFixedStar.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoFixedStar.h 2013-07-27 09:14:20.000000000 +0000 @@ -80,11 +80,14 @@ double const * getPos() const; ///< Get const pointer to pos_ void getPos(double* dst) const; ///< Get a copy of the pos_ array virtual void setMetric(SmartPointer metric) ; + using UniformSphere::setRadius; virtual void setRadius(double radius); ///< Set radius void setPos(const double[3]); ///< Set pos_ array // void setCoordSys(int); ///< set coordinate system - virtual int setParameter(std::string name, std::string content); + virtual int setParameter(std::string name, + std::string content, + std::string unit); public: #ifdef GYOTO_USE_XERCES diff -Nru gyoto-0.0.3/include/GyotoFocalPlane.h gyoto-0.1.0/include/GyotoFocalPlane.h --- gyoto-0.0.3/include/GyotoFocalPlane.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoFocalPlane.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/** - * \file GyotoFocalPlane.h - * \brief Observed image - * - * A bunch of Gyoto::Photon instances - */ -/* - Copyright 2011 Thibaut Paumard, Frederic Vincent - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - -#ifndef __GyotoFocalPlane_H_ -#define __GyotoFocalPlane_H_ - -namespace Gyoto { - class FocalPlane; -} - -#include -#include -#include - -/** - * \classe Gyoto::FocalPlane - * \brief Observed image - * - * A grid of Gyoto::Photon instances - */ -class Gyoto::FocalPlane { - protected: - SmartPointer gg_; - SmartPointer obj_; - size_t nx_; - size_t ny_; - double dx_; ///< radians - double dy_; ///< radians - double xmin_; ///< radians - double ymin_; ///< radians - public: - FocalPlane(SmartPointer gg, SmartPointer obj, - double xmin, double ymin, - size_t nx, size_t ny, double dx, double dy); - FocalPlane(SmartPointer gg, SmartPointer obj, - double xmin, double ymin, double xmax, double ymax, - size_t nx, size_t ny); - ~FocalPlane(); - - /** - * \param double dest[nx][ny] - */ - void hitMap(double *dest); - size_t getNx() const; - size_t getNy() const; - double getDx() const; - double getDy() const; - double getXmin() const; - double getYmin() const; - double getXmax() const; - double getYmax() const; - - /** - * \param double dest[] : an nx-length array of doubles which will - * hold the x values upon completion. - */ - void getX(double * dest) const; ///< Get X axis - - /** - * \param double dest[] : an ny-length array of doubles which will - * hold the x values upon completion. - */ - void getY(double * dest) const; ///< Get Y axis - - // void hitMap(double tobs, double *dest, double deltatau=0.1) ; - -}; - -#endif diff -Nru gyoto-0.0.3/include/GyotoFunctors.h gyoto-0.1.0/include/GyotoFunctors.h --- gyoto-0.0.3/include/GyotoFunctors.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoFunctors.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,8 +1,6 @@ /** * \file GyotoFunctors.h - * \brief Classes which an operator() method - - + * \brief Classes with an operator() method */ /* @@ -29,15 +27,64 @@ #define __GyotoFunctors_H_ namespace Gyoto { + /** + * \namespace Gyoto::Functor + * \brief Classes with an operator() method + */ namespace Functor { class Double_constDoubleArray; + class Double_Double_const; } } +/** + * \brief A functor like double (func) (double const data[]) + */ class Gyoto::Functor::Double_constDoubleArray { public: + /** + * \brief The actual function + */ virtual double operator()(double const data[]) = 0; }; + +/** + * \brief A functor like double (func) (double) const + */ +class Gyoto::Functor::Double_Double_const +{ + public: + /** + * \brief Exit status code of "various" methods (at least secant() !) + */ + int status; + + /** + * \brief The actual function + */ + virtual double operator()(double) const = 0; + + /** + * \brief Ridder's root-finding method applied on operator()() + * \param from, to boundaries for root-searching + * \return the root + */ + double ridders(double from, double to) const; + + /** + * \brief Secant root-finding method applied on operator()() + * + * Sets status to + * -0 in case of convergence + * -1 if two distinct inputs evaluated to the same output + * -2 if maximum number of iterations (20) reached + * + * \param from, to boundaries for root-finding + * \return the root + */ + double secant(double from, double to); +}; + #endif diff -Nru gyoto-0.0.3/include/GyotoHooks.h gyoto-0.1.0/include/GyotoHooks.h --- gyoto-0.0.3/include/GyotoHooks.h 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/include/GyotoHooks.h 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,141 @@ +/** + * \file GyotoHooks.h + * \brief Tellers tell Listeners when they mutate + * + * A Listener can hook() to a Teller. The Teller will tell it when + * it mutates using Listener::tell(), usually through the highter + * lever Teller::tellListeners(). The Listener can later + * unhook(). The Listener must therefore implement Listener::tell() + * to react when it is told. + */ + +/* + Copyright 2012-2013 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#ifndef __GyotoHooks_h +#define __GyotoHooks_h + +/** + * \namespace Gyoto::Hook + * \brief Listeners attach to Tellers + * + * A Listener can hook() to a Teller. The Teller will tell it when + * it mutates using Listener::tell(), usually through the highter + * lever Teller::tellListeners(). The Listener can later + * unhook(). The Listener must therefore implement Listener::tell() + * to react when it is told. + */ +namespace Gyoto { + namespace Hook { + /** + * \class Teller + * \brief Listen to me and I'll warn you when I change + * + * Listen to me by calling my hook() method. + */ + class Teller; + + /** + * \class Listener + * \brief I might listen to a Teller + * + * Whisper to my ear by using my tell() method. + */ + class Listener; + }; +}; + +class Gyoto::Hook::Listener { + friend class Gyoto::Hook::Teller; + public: + Listener(); ///< Constructor + ~Listener(); ///< Destructor + + protected: + /** + * \brief This is how a Teller tells + * + * A teller will basically call listener->tell(this). + * + * \param msg Teller* the Teller who is telling... Useful if the + * Listener listens to several Tellers. + */ + virtual void tell(Gyoto::Hook::Teller *msg); +}; + +class Gyoto::Hook::Teller { + friend class Gyoto::Hook::Listener; + private: + /** + * \class ListenerItem + * \brief Private (undocumented) class to hold listeners_ + */ + class ListenerItem; + + /** + * \brief Linked list of Listener items + */ + ListenerItem *listeners_; + + public: + Teller(); ///< Default constructor + Teller(const Teller &); ///< Copy constructor + ~Teller(); ///< Destructor + + /** + * \brief Start listening + * + * Use from a Hook::Listener object method: + * \code + * teller->hook(this) + * \endcode + * where "this" is a Listener and "teller" is a Teller. + * + * Use unhook() later to stop listening to a given Teller. + * + * \param listener pointer to the new listener + */ + virtual void hook (Listener * listener); + + /** + * \brief Stop listening + * + * Use from a Hook::Listener object method: + * \code + * teller->unhook(this) + * \endcode + + * where "this" is a Listener, "teller" is a Teller, and "this" has + * called teller->hook(this) previously. + * + * \param listener pointer to the listener + */ + virtual void unhook (Listener * listener); + + protected: + /** + * \brief Call tell() on each hooked Listener + * + * Whenever a Teller mutates, it should warn any Listener hooked to + * it using tellListeners(). + */ + virtual void tellListeners(); +}; + +#endif diff -Nru gyoto-0.0.3/include/GyotoKerrBL.h gyoto-0.1.0/include/GyotoKerrBL.h --- gyoto-0.0.3/include/GyotoKerrBL.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoKerrBL.h 2013-07-27 09:14:20.000000000 +0000 @@ -49,6 +49,7 @@ // ----- protected: double spin_ ; ///< Angular momentum parameter + int modifkerr_CS_; ///< Chern-Simons modification // Constructors - Destructor // ------------------------- @@ -57,7 +58,7 @@ KerrBL(double spin, double mass) ; ///< Constructor with spin and mass specification // Default is _not_ fine - //KerrBL(const KerrBL& ) ; ///< Copy constructor + KerrBL(const KerrBL& ) ; ///< Copy constructor virtual ~KerrBL() ; ///< Destructor @@ -80,12 +81,12 @@ double getRmb() const; ///< Returns prograde marginally bound orbit - /** Value of metric coefficient $g_{\alpha\beta}$ at point $(x_{1},x_{2},x_{3})$ - in Boyer-Lindquist coordinates - */ - double gmunu(const double * const x, - int alpha, int beta) const ; + double gmunu(const double * const x, int mu, int nu) const ; + /** + * \brief gμ,ν + */ + double gmunu_up(const double * const x, int mu, int nu) const ; /* it's necessary to define christoffel even if it's not used. KerrBL derives from Metric where christoffel is virtual pure. If the function is not defined in KerrBL, it's considered virtual pure here too. Then KerrBL is considered an abstract class, and it's forbidden to declare any object of type KerrBL.... @@ -95,8 +96,8 @@ double christoffel(const double[8], const int, const int, const int) const; - double ScalarProd(const double* pos, - const double* u1, const double* u2) const ; + double ScalarProd(const double pos[4], + const double u1[4], const double u2[4]) const ; void nullifyCoord(double coord[8], double & tdot2) const; void nullifyCoord(double coord[8]) const; @@ -108,7 +109,7 @@ double dir=1.) const ; public: - void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const ; + virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const ; ///< Inverse function of MakeMomentumAndCst ///< Computes pr, ptheta, E and L from rdot, thetadot, phidot, tdot @@ -116,10 +117,9 @@ ///< Transforms from Boyer-Lindquist coordinates [t,r,th,phi,tdot,rdot,thdot,phidot] to [t,r,th,phi,pt,pr,pth,pphi] where pt,pr... are generalized momenta. + virtual void setParameter(std::string, std::string, std::string); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp); ///< called from Factory - static Metric::Subcontractor_t Subcontractor; - static void Init(); #endif protected: @@ -128,18 +128,35 @@ /* RK4 : y=[r,theta,phi,t,pr,ptheta], cst=[a,E,L,Q,1/Q],dy/dtau=F(y,cst), h=proper time step. For KerrBL geodesic computation. */ int myrk4(Worldline * line, const double coordin[8], double h, double res[8]) const; //external-use RK4 - int myrk4(const double coor[8], const double cst[5], double h, double res[8]) const;//internal-use RK4 - int myrk4_adaptive(Gyoto::Worldline* line, const double coor[8], double lastnorm, double normref, double coor1[8], double h0, double& h1) const; + private: + int myrk4(const double coor[8], const double cst[5], double h, double res[8]) const;///< Internal-use RK4 proxy + int myrk4_adaptive(Gyoto::Worldline* line, const double coor[8], double lastnorm, double normref, double coor1[8], double h0, double& h1) const; ///< Interal-use adaptive RK4 proxy + /** + * \brief Ensure conservation of the constants of motion + * + * Tweak thetadot if necessary. + */ int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const; + + /** + * \brief Normalize 4-velocity + * + * To 0 or -1. Changes rdot to allow norm conservation. + */ void Normalize4v(double coord[8], const double part_mass) const; /** F function such as dy/dtau=F(y,cst) */ using Metric::Generic::diff; - int diff(const double y[8], const double cst[5], double res[8]) const ; + /** + * \brief Used in RK4 proxies. + */ + virtual int diff(const double y[8], const double cst[5], + double res[8]) const ; /** Integrator. Computes the evolution of y (initcond=y(0)). */ - void computeCst(const double coord[8], double cst[5]) const; + virtual void computeCst(const double coord[8], double cst[5]) const; + public: void setParticleProperties(Worldline* line, const double* coord) const; }; diff -Nru gyoto-0.0.3/include/GyotoKerrKS.h gyoto-0.1.0/include/GyotoKerrKS.h --- gyoto-0.0.3/include/GyotoKerrKS.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoKerrKS.h 2013-07-27 09:14:20.000000000 +0000 @@ -74,9 +74,6 @@ public: double getSpin() const ; ///< Returns spin - /** Value of metric coefficient $g_{\alpha\beta}$ at point $(x_{1},x_{2},x_{3})$ - in Kerr-Schild coordinates - */ double gmunu(const double * x, int alpha, int beta) const ; @@ -95,12 +92,9 @@ virtual void circularVelocity(double const pos[4], double vel [4], double dir=1.) const ; - // friend std::ostream& operator<<(std::ostream& , const KerrKS& ) ; - // std::ostream& print(std::ostream&) const ; + virtual void setParameter(std::string, std::string, std::string); #ifdef GYOTO_USE_XERCES - virtual void fillElement(FactoryMessenger *fmp); ///< called from Factory - static Metric::Subcontractor_t Subcontractor; - static void Init(); + virtual void fillElement(FactoryMessenger *fmp); #endif public: @@ -109,11 +103,29 @@ ///< In Kerr-Schild coordinates [T,x,y,z,Tdot,xdot,ydot,zdot], computes the four constants of the movement : particule mass, energy, angular momentum and Carter's constant. protected: - // outside the API - /* RK4 : y=[r,theta,phi,t,pr,ptheta], cst=[a,E,L,Q],dy/dtau=F(y,cst), h=proper time step. For KerrKS geodesic computation. + /** + * \brief RK4 integrator + * + * Wrapper around myrk4(const double * coord, const double* cst , double h, double* res) const + * + * */ int myrk4(Worldline * line, const double coord[8], double h, double res[8]) const;//NB non adaptive integration doesn't work for KS ; this function is not implemented + + /** + * \brief RK4 integrator + * \param coord [r,theta,phi,t,pr,ptheta] + * \param cst [a,E,L,Q],dy/dtau=F(y,cst) + * \param h proper time step. + * \param res result + */ int myrk4(const double * coord, const double* cst , double h, double* res) const; + + /** + * \brief ? + * + * Is it ever called? + */ int myrk4_adaptive(Gyoto::Worldline* line, const double * coord, double lastnorm, double normref, double* coord1, double h0, double& h1) const; /** F function such as dy/dtau=F(y,cst) diff -Nru gyoto-0.0.3/include/GyotoLoreneMetric.h gyoto-0.1.0/include/GyotoLoreneMetric.h --- gyoto-0.0.3/include/GyotoLoreneMetric.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoLoreneMetric.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/** - * \file GyotoLoreneMetric.h - * \brief Lorene computed metric - * - */ - -/* - Copyright 2011 Frederic Vincent - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - -#ifndef __GyotoLoreneMetric_H_ -#define __GyotoLoreneMetric_H_ - -namespace Gyoto { - class LoreneMetric; -} - -#include - -/** - * \class Gyoto::LoreneMetric - * \brief Gyoto::Metric for Lorene computed metric - */ -class Gyoto::LoreneMetric : public Metric { - friend class Gyoto::SmartPointer; - - // Data : - // ----- - protected: - - // Constructors - Destructor - // ------------------------- - public: - LoreneMetric(); ///< Default constructor - - // Default is _not_ fine - LoreneMetric(const LoreneMetric& ) ; ///< Copy constructor - - - virtual ~LoreneMetric() ; ///< Destructor - - - // Mutators / assignment - // --------------------- - public: - - // Accessors - // --------- - public: - - /** Value of metric coefficient $g_{\alpha\beta}$ at point $(x_{1},x_{2},x_{3})$ - in Boyer-Lindquist coordinates - */ - virtual double gmunu(const double * const x, - const int alpha, const int beta, - const int sys) const ; - - - /* - it's necessary to define christoffel even if it's not used. LoreneMetric derives from Metric where christoffel is virtual pure. If the function is not defined in LoreneMetric, it's considered virtual pure here too. Then LoreneMetric is considered an abstract class, and it's forbidden to declare any object of type LoreneMetric.... - See Delannoy C++ p.317-318 - NB : and it's not necessary to declare "virtual" a function in a derived class if it has been declared "virtual" in the basis class. - */ - double christoffel(const double[8], - const int, const int, const int, - const int) const; - - virtual double ScalarProd(const double* pos, - const double* u1, const double* u2, - const int sys) const ; - - friend std::ostream& operator<<(std::ostream& , const LoreneMetric& ) ; - std::ostream& print(std::ostream&) const ; - - public: - - protected: - /* RK4 : y=[r,theta,phi,t,pr,ptheta], cst=[a,E,L,Q],dy/dtau=F(y,cst), h=proper time step. For Kerr geodesic computation. - */ - int myrk4_BL(const double y[6], const double* cst, double h, double* res) const; - int myrk4_BL_adaptive(const double coor[8], const double* cst, const double MassPart, double lastnorm, double normref, int noprogress, double* coor1, double h0, double& h1, int onestep) const;//noprogress is 1 if integration makes no progress - - /** F function such as dy/dtau=F(y,cst) - */ - int diff_BL(const double* y, const double* cst, double* res) const ; - -}; - - -#endif diff -Nru gyoto-0.0.3/include/GyotoMetric.h gyoto-0.1.0/include/GyotoMetric.h --- gyoto-0.0.3/include/GyotoMetric.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoMetric.h 2013-07-27 09:14:20.000000000 +0000 @@ -8,7 +8,7 @@ */ /* - Copyright 2011 Frederic Vincent, Thibaut Paumard + Copyright 2011, 2013 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -33,15 +33,16 @@ #include #include -#include #include #include #include +#include namespace Gyoto { namespace Metric { class Generic; + /// A function to build instances of a specific Metric::Generic sub-class /** * This is a more specific version of the * SmartPointee::Subcontractor_t type. A Metric::Subcontrator_t is @@ -51,46 +52,71 @@ * Gyoto::FactoryMessenger. */ typedef SmartPointer Subcontractor_t(FactoryMessenger*); - ///< A function to build instances of a specific Metric::Generic sub-class + + /** + * \brief Subcontractor template + * + * Instead of reimplementing the wheel, your subcontractor can simply be + * Gyoto::Metric::Subcontractor + * + * \tparam T Sub-class of Metric::Generic + */ + template SmartPointer Subcontractor + (FactoryMessenger* fmp) { + SmartPointer gg = new T(); + gg -> setParameters(fmp); + return gg; + } + + /// Query the Metric register /** * Query the Metric register to get the Metric::Subcontractor_t * correspondig to a given kind name. This function is normally * called only from the Factory. * * \param name e.g. "KerrBL" + * \param errmode int=0. If errmode==0, failure to find a + * registered Metric by that name is an error. Else, simply + * return NULL pointer in that case. * \return pointer to the corresponding subcontractor. */ - Gyoto::Metric::Subcontractor_t* getSubcontractor(std::string name); - ///< Query the Metric register + Gyoto::Metric::Subcontractor_t* getSubcontractor(std::string name, + int errmode=0); + /// The Metric register /** * Use the Metric::initRegister() once in your program to * initiliaze it, the Metric::Register() function to fill it, and * the Metric::getSubcontractor() function to query it. */ extern Register::Entry * Register_; - ///< The Metric register + /// Make a Metric kind known to the Factory /** * Register a new Metric::Generic sub-class so that the * Gyoto::Factory knows it. * - * \param name The kind name which identifies this object type in + * \param kind The kind name which identifies this object type in * an XML file, as in <Metric kind="name"> * * \param scp A pointer to the subcontractor, which will * communicate whith the Gyoto::Factory to build an instance of * the class from its XML description */ - void Register(std::string kind, Gyoto::Metric::Subcontractor_t*); - ///< Make a Metric kind known to the Factory + void Register(std::string kind, Gyoto::Metric::Subcontractor_t* scp); + /// Empty the Metric register. /** - * This must be called once. + * This must be called once. It is called by + * Gyoto::Register::init(). */ - void initRegister(); ///< Empty the Metric register. + void initRegister(); + } + + /* Documented elswhere */ + class Worldline; } /** @@ -108,30 +134,34 @@ * \class Gyoto::Metric::Generic * \brief Base class for metrics * - * Example: class Gyoto::Kerr + * Example: class Gyoto::Metric::KerrBL * * See Gyoto::Metric for an introduction. * */ -class Gyoto::Metric::Generic : protected Gyoto::SmartPointee { +class Gyoto::Metric::Generic +: protected Gyoto::SmartPointee, + public Gyoto::Hook::Teller +{ friend class Gyoto::SmartPointer; private: - std::string kind_; + std::string kind_; ///< Metric kind name (e.g. "KerrBL") double mass_; ///< Mass yielding geometrical unit (in kg). int coordkind_; ///< Kind of coordinates (cartesian-like, spherical-like, unspecified) public: - const std::string getKind() const; - void setKind(const std::string); + const std::string getKind() const; ///< Get kind_ + void setKind(const std::string); ///< Set kind_ int getRefCount(); // Constructors - Destructor // ------------------------- //Metric(const Metric& ) ; ///< Copy constructor Generic(); - Generic(const int coordkind); + Generic(const int coordkind); ///< Constructor setting Generic::coordkind_ Generic(const double mass, const int coordkind); + ///< Constructor setting Generic::mass_ and Generic::coordkind_ virtual ~Generic() ; ///< Destructor @@ -140,7 +170,7 @@ virtual Generic * clone() const ; ///< Virtual copy constructor void setMass(const double); ///< Set mass used in unitLength() - void setMass(const double, std::string unit); ///< Set mass used in unitLength() + void setMass(const double, const std::string &unit); ///< Set mass used in unitLength() // Accessors @@ -148,6 +178,7 @@ void setCoordKind(int coordkind); ///< Set coordinate kind double getMass() const; ///< Get mass used in unitLength() + double getMass(const std::string &unit) const; ///< Get mass used in unitLength() /** * Metrics implementations are free to express lengths and distances @@ -155,14 +186,15 @@ * units). This function returns this unit in SI (meters). */ double unitLength() const ; ///< M * G / c^2, M is in kg, unitLength in meters + double unitLength(const std::string &unit) const ; ///< unitLength expressed in specified unit virtual void cartesianVelocity(double const coord[8], double vel[3]); ///< Compute xprime, yprime and zprime from 8-coordinates /** - * \param coord[4] 4-position (geometrical units); - * \param v[3] 3-velocity dx1/dx0, dx2/dx0, dx3/dx0; + * \param coord 4-position (geometrical units); + * \param v 3-velocity dx1/dx0, dx2/dx0, dx3/dx0; * \return tdot = dx0/dtau. */ virtual double SysPrimeToTdot(const double coord[4], const double v[3]) const; @@ -170,7 +202,7 @@ /** * \brief Yield circular valocity at a given position (projected on - * equatorial plane. + * equatorial plane). * * \param pos input: position, * \param vel output: velocity, @@ -182,10 +214,12 @@ /** * Set coord[4] so that the 4-velocity coord[4:7] is lightlike, * i.e. of norm 0. There may be up to two solutions. coord[4] is set - * to the hightest. The lowest can be retrieved in tdot2. Everything - * is expressed in geometrical units. + * to the hightest. The lowest can be retrieved using + * nullifyCoord(double coord[8], double& tdot2) const. Everything is + * expressed in geometrical units. * - * \param coord[4] 8-position, coord[4] will be set according to the other elements; + * \param[in,out] coord 8-position, coord[4] will be set according + * to the other elements; */ virtual void nullifyCoord(double coord[8]) const; ///< Set tdot (coord[4]) such that coord is light-like. Everything is in geometrical units. @@ -196,8 +230,9 @@ * to the hightest. The lowest can be retrieved in tdot2. Everything * is expressed in geometrical units. * - * \param coord[4] 8-position, coord[4] will be set according to the other elements; - * \param tdot2 will be set to the smallest solution + * \param[in,out] coord 8-position, coord[4] will be set according + * to the other elements; + * \param[out] tdot2 will be set to the smallest solution */ virtual void nullifyCoord(double coord[8], double& tdot2) const; ///< Set tdot (coord[4]) such that coord is light-like and return other possible tdot @@ -206,9 +241,9 @@ /** * Compute the scalarproduct of the two quadrivectors u1 and u2 in * this Metric, at point pos expressed in coordinate system sys. - * \param pos[4] 4-position; - * \param u1[4] 1st quadrivector; - * \param u2[4] 2nd quadrivector; + * \param pos 4-position; + * \param u1 1st quadrivector; + * \param u2 2nd quadrivector; * \return u1*u2 */ virtual double ScalarProd(const double pos[4], @@ -217,8 +252,58 @@ virtual double Norm3D(double* pos) const; ///< not clear + /** + * \brief Set parameter by name + * + * Assume MyKind is a subclass of Metric::Generic which has two + * members (a string StringMember and a double DoubleMember): +\code +int MyKind::setParameter(std::string name, std::string content, std::string unit) { + if (name=="StringMember") setStringMember(content); + else if (name=="DoubleMember") setDoubleMemeber(atof(content.c_str()), unit); + else return Generic::setParameter(name, content, unit); + return 0; +} +\endcode + * If MyKind is not a direct subclass of Generic, it should call the + * corresponding setParameter() implementation instead of + * Generic::setParameter(). + * + * \param name XML name of the parameter + * \param content string representation of the value + * \param unit string representation of the unit + * \return 0 if this parameter is known, 1 if it is not. + */ + virtual void setParameter(std::string name, + std::string content, + std::string unit); + // Outputs #ifdef GYOTO_USE_XERCES + + /** + * \brief Main loop in Subcontractor_t function + * + * The Subcontractor_t function for each Metric kind should look + * somewhat like this (templated as + * Gyoto::Metric::Subcontractor): +\code +SmartPointer +Gyoto::Metric::MyKind::Subcontractor(FactoryMessenger* fmp) { + SmartPointer gg = new MyKind(); + gg -> setParameters(fmp); + return gg; +} +\endcode + * + * Each metric kind should implement setParameter(string name, + * string content, string unit) to interpret the individual XML + * elements. setParameters() can be overloaded in case the specific + * Metric class needs low level access to the FactoryMessenger. See + * Gyoto::Astrobj::UniformSphere::setParameters(). + */ + virtual void setParameters(Gyoto::FactoryMessenger *fmp) ; + /** * Metrics implementations should impement fillElement to save their * parameters to XML and call the Metric::fillElement(fmp) for the @@ -226,56 +311,66 @@ */ virtual void fillElement(FactoryMessenger *fmp) ; ///< called from Factory + + /** + * \brief Process generic XML parameters + */ void processGenericParameters(Gyoto::FactoryMessenger *fmp) ; #endif - /// Display - // friend std::ostream& operator<<(std::ostream& , const Metric& ) ; - // std::ostream& print(std::ostream&) const ; - /** - * - * \param x[4] 4-position at which to compute the coefficient; - * \param 0<=mu<=3 1st index of coefficient; - * \param 0<=nu<=3 2nd index of coefficient; - * \param sys coordinate systemp in which x is expressed (see - * GyotoMetric.h) - * \return Metric coefficient $g_{mu, nu}$ at point x + * \brief Metric coefficients + * + * \param x 4-position at which to compute the coefficient; + * \param mu 1st index of coefficient, 0≤μ≤3; + * \param nu 2nd index of coefficient, 0≤ν≤3; + * \return Metric coefficient gμ,ν at point x */ virtual double gmunu(const double * x, int mu, int nu) const - = 0 ; ///< Metric coefficients + = 0 ; /** - * Value of Christoffel symbol $\Gamma^{\alpha}_{\mu\nu}$ at point - * $(x_{1},x_{2},x_{3})$ + * \brief Chistoffel symbol + * + * Value of Christoffel symbol + * Γαμν at point + * (x1, x2, x3). */ virtual double christoffel(const double coord[8], const int alpha, const int mu, const int nu) const = 0; + /** + * \brief RK4 integrator + */ virtual int myrk4(Worldline * line, const double coord[8], double h, double res[8]) const; + /** + * \brief RK4 integrator with adaptive step + */ virtual int myrk4_adaptive(Gyoto::Worldline* line, const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1) const; /** + * \brief Check whether integration should stop + * * The integrating loop will ask this the Metric through this method * whether or not it is happy to conitnue the integration. * Typically, the Metric should answer 0 when everything is fine, 1 * when too close to the event horizon, inside the BH... * - * \param coord[8] coordinates to check. + * \param coord 8-coordinate vector to check. */ virtual int isStopCondition(double const * const coord) const; /** - * F function such as dy/dtau=F(y,cst) + * \brief F function such as dy/dtau=F(y,cst) */ virtual int diff(const double y[8], double res[8]) const ; /** - * Set Metric-specific constants of motion. Used e.g. in KerrBL. + * \brief Set Metric-specific constants of motion. Used e.g. in KerrBL. */ virtual void setParticleProperties(Gyoto::Worldline* line, const double * coord) const; diff -Nru gyoto-0.0.3/include/GyotoPageThorneDisk.h gyoto-0.1.0/include/GyotoPageThorneDisk.h --- gyoto-0.0.3/include/GyotoPageThorneDisk.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoPageThorneDisk.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,8 +1,14 @@ /** - * \file GyotoThinInfiniteDiskBL.h + * \file GyotoPageThorneDisk.h * \brief A geometrically thin, optically thick disk * - * The target of ray-traced Gyoto::Photon + * This class describes a disk contained in the z=0 (equatorial) + * plane, extending from r=r_ISCO to r=infinity. The flux emitted + * at radius r is given by Page & Thorne (1974, ApJ 191:499, + * Eqs. 11b, 14, 15). + * + * Only bolometric flux is implemented (as quantity User4), no + * spectral resolution. */ /* @@ -47,22 +53,27 @@ * at radius r is given by Page & Thorne (1974, ApJ 191:499, * Eqs. 11b, 14, 15). * - * The metric must be either KerrBL or KerrKS. - * - * Warning: The spin value and the inner radius are cached when the - * metric is assigned using setMetric(). If the spin is later - * changed in the metric, updateSpin() must be called. + * The metric must be either KerrBL or KerrKS. Emission, Spectrum + * and BinSpectrum are not provide, the only + * intensity provided is provided, as quantity User4 and it is the + * default quantity returned if nothing is requested. The other + * quantities implemented in ThinDisk are also provided. * */ -class Gyoto::Astrobj::PageThorneDisk : public Astrobj::ThinDisk { +class Gyoto::Astrobj::PageThorneDisk +: public Astrobj::ThinDisk, + public Hook::Listener +{ friend class Gyoto::SmartPointer; private: - double aa_; ///< Spin - double aa2_; - double x0_; - double x1_; - double x2_; - double x3_; + double aa_; ///< Generic::gg_ spin parameter, monitored by tell() + double aa2_; ///< aa_2 + double x0_; ///< Value cached for bolometricEmission() + double x1_; ///< Value cached for bolometricEmission() + double x2_; ///< Value cached for bolometricEmission() + double x3_; ///< Value cached for bolometricEmission() + int rednoise_; ///< Flag for rednoise-like flux + int uniflux_; ///< Flag for uniform flux = 1 // Constructors - Destructor // ------------------------- @@ -85,8 +96,49 @@ ///< Get spin from metric, which must be KerrBL or KerrKS public: + using ThinDisk::emission; + /** + * \brief Not implemented + * Throws a Gyoto::Error + */ virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; + + /** + * \brief Bolometric emission + * + * Similar to Generic::emission(), but bolometric. + */ + virtual double bolometricEmission(double dsem, + double c_obj[8]) const; + + /** + * \brief + * processHitQuantities fills the requested data in Impact. For + * PageThorneDisk, only fill User4, which corresponds to bolometric + * intensity. + */ + virtual void processHitQuantities(Photon* ph, double* coord_ph_hit, + double* coord_obj_hit, double dt, + Astrobj::Properties* data) const; + + int setParameter(std::string name, + std::string content, + std::string unit); + + Quantity_t getDefaultQuantities(); + + // Hook::Listener API // + public: + /** + * \brief Update PageThorneDisk::aa_ + * + * Calls updateSpin(). + * + * See Hook::Listener::tell() + */ + virtual void tell(Gyoto::Hook::Teller *msg); + public: #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory diff -Nru gyoto-0.0.3/include/GyotoPatternDisk.h gyoto-0.1.0/include/GyotoPatternDisk.h --- gyoto-0.0.3/include/GyotoPatternDisk.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoPatternDisk.h 2013-07-27 09:14:20.000000000 +0000 @@ -51,27 +51,27 @@ class Gyoto::Astrobj::PatternDisk : public Astrobj::ThinDisk { friend class Gyoto::SmartPointer; private: - std::string filename_; + std::string filename_; ///< Optional FITS file name containing the arrays /** * An array of dimensionality double[nr_][nphi_][nnu_]. In FITS * format, the first dimension is nu, the second phi, and the third * r. */ - double * emission_; ///< Inu(nu, r, phi) + double * emission_; ///< Iν(ν, r, φ) - double * opacity_; ///< same dimenstions as emission, or NULL + double * opacity_; ///< Same dimenstions as emission, or NULL /** * An array of dimensionality double[nr_][nphi_][2]. In FITS format, * the second dimension is phi, and the third r. The first plane in - * the first FITS dimention is dphi/dt, the second dr/dt. + * the first FITS dimention is dφ/dt, the second dr/dt. */ - double * velocity_; ///< velocity(, r, phi) + double * velocity_; ///< velocity(r, φ) /** * In case of adaptive grid. */ - double * radius_; ///< radius vector + double * radius_; ///< Radius vector /** * XML element: <Omega>. @@ -85,26 +85,23 @@ */ double t0_; ///< Date for which i=0 corresponds to phi=0 - double dnu_; - double nu0_; - size_t nnu_; - - double dphi_; - double phimin_; - size_t nphi_; - double phimax_; + double dnu_; ///< Frequency scale of PatternDisk::emission_ in Hz + double nu0_; ///< Lowest frequency provided in PatternDisk::emission_ in Hz + size_t nnu_; ///< Number of frequencies provided in PatternDisk::emission_ + + double dphi_; ///< δφ between two grid columns + double phimin_;///< Minimum φ in grid + size_t nphi_; ///< Grid size in the φ direction + double phimax_; ///< Maximum φ in grid /** * XML elment: <RepeatPhi>. * FITS keyword: HIERARCH GYOTO PatternDisk RepeatPhi */ - size_t repeat_phi_; - //double phi0_==0, phi max is always 2*M_PI - - double dr_; - size_t nr_; - // double r0_; // this is rin_ + size_t repeat_phi_; ///< Number of times the pattern should be repeated to cover [0, 2Π] + double dr_; ///< Radius step + size_t nr_; ///< Number of rows in the patternGrid size in the r direction // Constructors - Destructor @@ -120,65 +117,154 @@ // Accessors // --------- public: - virtual void setInnerRadius(double); ///< Set rin_ - virtual void setOuterRadius(double); ///< Set rout_ + using ThinDisk::setInnerRadius; + virtual void setInnerRadius(double); + using ThinDisk::setOuterRadius; + virtual void setOuterRadius(double); /** * Unit: radians per geometrical unit time. */ - virtual void setPatternVelocity(double); ///< Set pattern angular velocity - virtual double getPatternVelocity(); ///< Set pattern angular velocity + virtual void setPatternVelocity(double); ///< Set PatternDisk::Omega_ + virtual double getPatternVelocity(); ///< Get PatternDisk::Omega_ + + /// Read parameters and arrays from FITS file virtual void fitsRead(std::string filename_); + + /// Write parameters and arrays to FITS file virtual void fitsWrite(std::string filename_); - ///< Read data from file + + /// Set PatternDisk::emission_ + /** + * The pointer is copied directly, not the array content. + * + * This is a low-level function. Beware that: + * - previously allocated array will not be freed automatically; + * - array attached when the destructor is called will be freed. + */ void setEmission(double * pattern); + + /// Set PatternDisk::velocity__ + /** + * The pointer is copied directly, not the array content. + * + * This is a low-level function. Beware that: + * - previously allocated array will not be freed automatically; + * - array attached when the destructor is called will be freed. + */ void setVelocity(double * pattern); + + /// Set PatternDisk::radius_ + /** + * The pointer is copied directly, not the array content. + * + * This is a low-level function. Beware that: + * - previously allocated array will not be freed automatically; + * - array attached when the destructor is called will be freed. + */ void setRadius(double * pattern); + + /// Set PatternDisk::emission_ /** - * \param pattern: new emission_ array. - * \param dims[3] = { nnu_, nphi_, nr_ }; + * PatternDisk::emission_ is freed if not NULL, reallocated, and + * pattern is copied into emission_. + * + * If PatternDisk::opacity_, PatternDisk::velocity_ or + * PatternDisk::radius_ have been set previously with mismatching + * sizes, they are deallocated too. + * + * Finally, PatternDisk::nnu_, PatternDisk::nphi_, and + * PatternDisk::nr_ are set according to naxes. + * + * \param pattern Array to copy as emission_. May be NULL in which + * case emission_ is simply deallocated and set to NULL. + * + * \param naxes { nnu_, nphi_, nr_ }. */ virtual void copyIntensity(double const * const pattern = NULL, size_t const naxes[3] = NULL); - ///< attach emission_ array and set its size - virtual double const * const getIntensity() const; - virtual void getIntensityNaxes( size_t naxes[3] ) const ; + virtual double const * getIntensity() const;///< Get PatternDisk::emission_ + virtual void getIntensityNaxes( size_t naxes[3] ) const ; ///< Get PatternDisk::nnu_, PatternDisk::nphi_, and PatternDisk::nr_ + + /** + * \brief Set PatternDisk::opacity_ + * + * PatternDisk::opacity_ is first freed if not NULL and set to NULL. + * + * If pattern is not NULL, PatternDisk::emission_ must have been set + * previously with matching dimensions. PatternDisk::opacity_ is + * then reallocated, and pattern is copied into opacity_. + * + * \param pattern Array to copy as opacity_. May be NULL in which + * case opacity_ is simply deallocated and set to NULL. + * + * \param naxes { nnu_, nphi_, nr_ }. + */ virtual void copyOpacity(double const * const pattern = NULL, size_t const naxes[3] = NULL); - virtual double const * const getOpacity() const; + virtual double const * getOpacity() const; ///< Get PatternDisk::opacity_ + /// Set PatternDisk::velocity_ + /** + * PatternDisk::velocity_ is first freed if not NULL and set to NULL. + * + * If pattern is not NULL, PatternDisk::emission_ must have been set + * previously with matching dimensions. PatternDisk::velocity_ is + * then reallocated, and pattern is copied into velocity_. + * + * \param pattern Array to copy as velocity_. May be NULL in which + * case velocity_ is simply deallocated and set to NULL. + * + * \param naxes { nphi_, nr_ }. + */ virtual void copyVelocity(double const * const pattern = NULL, size_t const naxes[2] = NULL); - virtual double const * const getVelocity() const; + virtual double const * getVelocity() const;///< Get PatternDisk::velocity_ + /// Set PatternDisk::radius_ + /** + * PatternDisk::radius_ is first freed if not NULL and set to NULL. + * + * If pattern is not NULL, PatternDisk::emission_ must have been set + * previously with matching dimensions. PatternDisk::radius_ is + * then reallocated, and pattern is copied into radius_. + * + * \param pattern Array to copy as radius_. May be NULL in which + * case radius_ is simply deallocated and set to NULL. + * + * \param nr size of radius array. + */ virtual void copyGridRadius(double const * const pattern = NULL, size_t nr = 0 ); - virtual double const * const getGridRadius() const; + virtual double const * getGridRadius() const; ///< Get PatternDisk::radius_ - virtual void repeatPhi(size_t n); - virtual size_t repeatPhi() const; + virtual void repeatPhi(size_t n); ///< Set PatternDisk::repeat_phi_ + virtual size_t repeatPhi() const; ///< Get PatternDisk::repeat_phi_ - virtual void nu0(double freq); - virtual double nu0() const; + virtual void nu0(double freq); ///< Set PatternDisk::nu0_ + virtual double nu0() const; ///< Get PatternDisk::nu0_ - virtual void dnu(double dfreq); - virtual double dnu() const; + virtual void dnu(double dfreq); ///< Set PatternDisk::dnu_ + virtual double dnu() const; ///< Get PatternDisk::dnu_ - void phimin(double phimin); - double phimin() const; + void phimin(double phimin); ///< Set PatternDisk::phimin_ + double phimin() const; ///< Get PatternDisk::phimin_ - void phimax(double phimax); - double phimax() const; + void phimax(double phimax); ///< Set PatternDisk::phimax_ + double phimax() const; ///< Get PatternDisk::phimax_ - virtual int setParameter(std::string name, std::string content); + virtual int setParameter(std::string name, + std::string content, + std::string unit); protected: void getIndices(size_t i[3], double const co[4], double nu=0.) const ; - ///< get emission_ cell corresponding to position co[4] + ///< Get emission_ cell corresponding to position co[4] public: + using ThinDisk::emission; virtual double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; virtual double transmission(double nu_em, double dsem, double coord[8]) const; diff -Nru gyoto-0.0.3/include/GyotoPatternDiskBB.h gyoto-0.1.0/include/GyotoPatternDiskBB.h --- gyoto-0.0.3/include/GyotoPatternDiskBB.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoPatternDiskBB.h 2013-07-27 09:14:20.000000000 +0000 @@ -3,7 +3,11 @@ * \brief A PatternDisk object with black body spectrum and * a power law extension up to some rmax_ * - * The target of ray-traced Gyoto::Photon + * A sort of composite of Astrobj::PatternDisk and + * Astrobj::ThinDiskPL. Behaves like the latter for r > + * PatternDiskBB::rPL_) and mostly like the former for r < + * PatternDiskBB::rPL_ except PatternDiskBB::emission_ does not yield + * directly Iν but temperature. */ /* @@ -50,6 +54,11 @@ * at radius r and longitude phi at frequency nu is given in a FITS * file. * + * A sort of composite of Astrobj::PatternDisk and + * Astrobj::ThinDiskPL. Behaves like the latter for r > + * PatternDiskBB::rPL_) and mostly like the former for r < + * PatternDiskBB::rPL_ except PatternDiskBB::emission_ does not yield + * directly Iν but temperature. */ class Gyoto::Astrobj::PatternDiskBB : public Astrobj::PatternDisk { friend class Gyoto::SmartPointer; @@ -57,10 +66,18 @@ SmartPointer spectrumBB_; ///< disk black body ///< emission law private: - int SpectralEmission_, PLDisk_; ///< Flags, are 1 if the disk emits - ///< as a black body or if the disk has a power law extension - double PLSlope_, PLRho_, rPL_, rmax_; ///< Power law slope, initial - ///< value, intial radius; maximal extension of the disk + /** + * \brief 1 if spectral emission. + * + * XML: SpectralEmission + * + */ + int SpectralEmission_; + int PLDisk_; ///< Whether the disk has a power law extension + double PLSlope_; ///< Mass density power-law slope + double PLRho_; ///< Mass density reference value + double rPL_; ///< Mass density reference radius + // double rmax_; ///< Maximal extension of the disk !!! see Astrobj::rmax_ // Constructors - Destructor // ------------------------- public: @@ -75,13 +92,14 @@ // --------- public: - int setParameter(std::string name, std::string content); + int setParameter(std::string name, std::string content, std::string unit); public: + using PatternDisk::emission; double emission(double nu_em, double dsem, double c_ph[8], double c_obj[8]) const; - double const * const getVelocity() const ; + double const * getVelocity() const ; void getVelocity(double const pos[4], double vel[4]) ; void setMetric(SmartPointer gg); ///< Insures metric is KerrBL diff -Nru gyoto-0.0.3/include/GyotoPhoton.h gyoto-0.1.0/include/GyotoPhoton.h --- gyoto-0.0.3/include/GyotoPhoton.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoPhoton.h 2013-07-27 09:14:20.000000000 +0000 @@ -54,11 +54,36 @@ // ----- protected: - SmartPointer object_; ///< The astronomical target - double freq_obs_; ///< Photon's frequency in observer's frame - double transmission_freqobs_; ///< integrated optical transmission + /// The astronomical target + /** + * The (only) possible origin for this Photon. + */ + SmartPointer object_; + + /// Photon's frequency in observer's frame + /** + * In Hz, for quantity Emission + */ + double freq_obs_; + + /// Integrated optical transmission + /** + * At Photon::freq_obs_, between current position and observer. + */ + double transmission_freqobs_; + + /// Observer's spectrometer + /** + * Conveying observation frequencies for quantities Spectrum and + * BinSpectrum. + */ + SmartPointer spectro_; - SmartPointer spectro_; + /// Integrated optical transmissions + /** + * For each frequency in Photon::spectro_->getMidpoints(), between + * current position and observer. + */ double * transmission_; // Constructors - Destructor @@ -73,29 +98,36 @@ */ Photon() ; ///< Default constructor Photon(const Photon& ) ; ///< Copy constructor - Photon* clone() const ; + Photon* clone() const ; ///< Cloner protected: Photon(Photon* orig, size_t i0, int dir, double step_max); - ///< Used by Photon::Refined::Refined + ///< Used by Photon::Refined::Refined() public: - Photon(SmartPointer gg, SmartPointer obj, + /// Same as Photon() followed by setInitialCondition(SmartPointer gg, SmartPointer obj, const double coord[8]) + Photon(SmartPointer gg, SmartPointer obj, double* coord) ; - ///< same as Photon() followed by setInitialCondition() + + /// Same as Photon() followed by setInitialCondition(SmartPointer gg, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta) Photon(SmartPointer gg, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta); - ///< same as Photon() followed by setInitialCondition() - // Constructor from a file (see \c sauve(FILE*) ) - //Photon(FILE* ) ; - virtual ~Photon() ; ///< Destructor virtual double getMass() const ; ///< Return 0. - void setAstrobj(SmartPointer); ///< Set Astrobj - SmartPointer getAstrobj() const ; ///< Get Astrobj - void setSpectrometer(SmartPointer spr); - SmartPointer getSpectrometer() const ; + /// Set Photon::object_ + void setAstrobj(SmartPointer); + /// Get Photon::object_ + SmartPointer getAstrobj() const ; + + /// Set Photon::spectro_ + void setSpectrometer(SmartPointer spr); + /// Get Photon::spectro_ + SmartPointer getSpectrometer() const ; + + /// Set Photon::freq_obs__ + void setFreqObs(double); + /// Get Photon::freq_obs__ double getFreqObs() const; @@ -105,69 +137,75 @@ /// Assignment to another Photon void operator=(const Photon&) ; + /// Set or re-set the initial condition prior to integration. /** * Set initial condition for this Photon : * - * \param gg : Gyoto::SmartPointer to the Gyoto::Metric in this universe; - * - * \param obj : Gyoto::SmartPointer to the target Gyoto::Astrobj; - * - * \param coord : 8 element array containing the initial condition, + * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this universe; + * \param obj Gyoto::SmartPointer to the target Gyoto::Astrobj; + * \param coord 8-element array containing the initial condition, * i.e. the 4-position and the 4-velocity of the Photon at * the receiving end; * */ - void setInitialCondition(SmartPointer gg, SmartPointer obj, const double coord[8]) ; - /// gg, + SmartPointer obj, + const double coord[8]) ; + /// Set or re-set the initial condition prior to integration. /** * Set initial condition for this Photon : * * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this universe; - * * \param obj Gyoto::SmartPointer to the target Gyoto::Astrobj; - * - * \param t0 Arrival date at observer's position - * - * \param d_alpha Direction of arrival (RA offset) in radians - * - * \param d_delta Direction of arrival (Dec offset) in radians + * \param screen Observer's screen; + * \param d_alpha Direction of arrival (RA offset) in radians; + * \param d_delta Direction of arrival (Dec offset) in radians. */ - void setInitialCondition(SmartPointer gg, SmartPointer obj, SmartPointer screen, double d_alpha, double d_delta); - /// gg, + SmartPointer obj, + SmartPointer screen, + double d_alpha, + double d_delta); - // int hit(double tlim, Astrobj::Properties *data=NULL); ///< Integrate the geodesic and tell whether this photon hits the object - int hit(Astrobj::Properties *data=NULL); ///< Integrate the geodesic and tell whether this photon hits the object + /// Integrate the geodesic + /** + * \param[in,out] data Optional Astrobj::Properties to fill with + * observational quantities. + * \return 1 if object was hit, else 0. + */ + int hit(Astrobj::Properties *data=NULL); /** * \brief Find minimum of photon--object distance * - * Return the minimum of object->Astrobj::operator()(this->getCoord()) + * Return the minimum of (*object)(this->getCoord()) * between t1 and t2. The date of this minimum is returned in tmin. * - * \param object the distance to minimize is given by - * object->Astrobj::operator()() - * \param t1 date - * \param t2 date - * \param tmin on output, date correspondig to the minimum - * \param threshold stop searching for a minimum if a value < - * threshold is found (very often, we just want to find - * a date below the threshold, not the accurate - * minimum). + * \param[in] object + * the distance to minimize is given by + * object->operator()(). This method is in particular + * implemented by the subclasses of Astrobj::Standard. + * \param[in] t1 date + * \param[in] t2 date + * \param[out] tmin on output, date correspondig to the minimum + * \param[in] threshold stop searching for a minimum if a value < + * threshold is found (very often, we just want to find + * a date below the threshold, not the accurate + * minimum). */ double findMin(Functor::Double_constDoubleArray* object, double t1, double t2, double &tmin, double threshold = DBL_MIN) ; + /// Find date for which the photon is at a given distance from the object /** - * \brief Find date for which the photon is at a given distance from - * the object - * - * \param object the object - * \param value the value to find - * \param a date for which + * \param[in] object Object, must implement operator() + * (e.g. Astrobj::Standard, ThinDisk::Standard) + * \param[in] value The value to find + * \param[in] tinside A date for which * object->Astrobj::operator()(Photon::getCoord()) is < value - * \param on input: a date for which + * \param[in,out] toutside On input: a date for which * object->Astrobj::operator()(Photon::getCoord()) is > * value. on output, (*object)(getCoord(toutside)) is < * value, very close to value. toutside is closer to tinside @@ -179,46 +217,57 @@ #ifdef GYOTO_USE_XERCES public: - void fillElement(FactoryMessenger *fmp); ///< called from Factory + /// Write XML description + void fillElement(FactoryMessenger *fmp); + /// Instanciate Photon from XML description + static SmartPointer Subcontractor(Gyoto::FactoryMessenger*); #endif /* transmission stuff */ public: - /** - * Set transmission to 1 for each channel as well as scalar transmission - */ - void resetTransmission() ; - /** - * Get either the transmission at freqObs (with i=-1) or the - * transmission at spectro_->getMidpoints()[i]. - * - * \param i channel number of the requested frequency, -1 for getFreqObs(). - */ - double getTransmission(size_t i) const ; - ///< get transmission for freqobs - - /** - * For i!=-1: getTansmission()[i] == getTransmission(size_t i) - */ - double const * getTransmission() const ; - ///< get pointer to transmission array - - /** - * Update transmission in a given channel: - * - * getTransmission(size_t i) *= t. - * - * \param i channel number. -1 for getFreqObs(). - * \param t transmission of this fluid element. - */ - virtual void transmit(size_t i, double t); + /// Set transmission to 1 for each channel as well as scalar transmission + void resetTransmission() ; + + /// Get transmission + /** + * Get either Photon::transmission_freqobs_ (with i=-1) or + * Photon::transmission_[i]. + * + * \param i channel number of the requested frequency, -1 for + * Photon::freq_obs_. + */ + double getTransmission(size_t i) const ; + + /// Get maximum transmission; + /** + * Get current maximum of all the transmissions, + * Photon::transmission_freqobs_ or one elements of the + * Photon::transmission_ array. + * + */ + double getTransmissionMax() const ; + + /// Get Photon::transmission_ + /** + * getTansmission()[i] == getTransmission(size_t i) + */ + double const * getTransmission() const ; + + /// Update transmission in a given channel + /** + * getTransmission(size_t i) *= t. + * + * \param i channel number. -1 for scalar Photon::transmission_freqobs_. + * \param t transmission of this fluid element. + */ + virtual void transmit(size_t i, double t); private: - void _allocateTransmission(); + /// Allocate Photon::transmission_ + void _allocateTransmission(); public: - class Refined; - ///< Refine last step of integration + class Refined; }; @@ -237,6 +286,11 @@ * * Don't use this class blindly: what's guaranteed to work is what is * used in Gyoto::ComplexAstrobj::Impact(). + * + * XML description corresponding to this class is <Photon/>. It + * supports all the parameters supported by the Gyoto::Worldline class + * plus an optional <Astrobj/> section to attach a instance of a + * Gyoto::Astrobj::Generic sub-class. */ class Gyoto::Photon::Refined : public Gyoto::Photon { protected: @@ -249,10 +303,4 @@ }; -#ifdef GYOTO_USE_XERCES -namespace Gyoto { - SmartPointer PhotonSubcontractor(Gyoto::FactoryMessenger*); -} -#endif - #endif diff -Nru gyoto-0.0.3/include/GyotoPolishDoughnut.h gyoto-0.1.0/include/GyotoPolishDoughnut.h --- gyoto-0.0.3/include/GyotoPolishDoughnut.h 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/include/GyotoPolishDoughnut.h 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,292 @@ +/** + * \file GyotoPolishDoughnut.h + * \brief A toroïdal accretion structure + * + * Reference: Straub, O.; Vincent, F. H.; Abramowicz, M. A.; + * Gourgoulhon, E.; & Paumard, T. 2012, Modelling the + * black hole silhouette in Sagittarius A* with ion tori, + * A&A 543:83. + * + */ + +/* + Copyright (c) 2012 Frederic Vincent, Odele Straub, Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#ifndef __GyotoPolishDoughnut_H_ +#define __GyotoPolishDoughnut_H_ + +namespace Gyoto{ + namespace Astrobj { class PolishDoughnut; } + class FactoryMessenger; +} + +//#include +#include +#include +#include +#include +//#include + +/** + * \brief A toroïdal accretion structure + * + * Reference: Straub, O.; Vincent, F. H.; Abramowicz, M. A.; + * Gourgoulhon, E.; & Paumard, T. 2012, Modelling the + * black hole silhouette in Sagittarius A* with ion tori, + * A&A 543:83. + * + */ +class Gyoto::Astrobj::PolishDoughnut +: public Astrobj::Standard, + protected Gyoto::Hook::Listener +{ + friend class Gyoto::SmartPointer; + + // Data : + // ----- +private: + /** + * \brief KerrBL metric + * + * This Astrobj::Generic subclass only works (so far?) in KerrBL + * metric. We store a copy of the Astrobj::Generic::gg_ + * SmartPointer appropriately cast. The two pointers point to the + * same instance. + */ + SmartPointer gg_; + double l0_; ///< Angular momentum. Tied to PolishDoughnut::lambda_. + double lambda_; ///< Adimentionned angular momentum + double W_surface_; ///< Potential surface value. Tied to PolishDoughnut::lambda_. + double W_centre_; ///< Potential central value. Tied to PolishDoughnut::lambda_. + double r_cusp_; ///< Cusp radius in geometrical units. Tied to PolishDoughnut::lambda_. + double r_centre_; ///< Central radius in geometrical units. Tied to PolishDoughnut::lambda_. + double DeltaWm1_; ///< 1./(W_centre_ - W_surface_); + double temperature_ratio_; ///< Central ion/electron temperature ratio + double central_density_; ///< Central density in kg/L (same as g cm^-3) + double centraltemp_over_virial_; ///< Tcenter/Tvirial + double beta_; ///< Pmagn/Pgas + int use_specific_impact_ ;///< Use PolishDoughnut::Impact_() or Standard::Impact() + double aa_; ///< PolishDoughnut::gg_ spin, cached when setting PolishDoughnut::lambda_ + double aa2_; ///< aa_2 + size_t spectral_oversampling_;///< Oversampling used in integrateEmission() + + // Constructors - Destructor + // ------------------------- +public: + PolishDoughnut() ; ///< Default constructor + //PolishDoughnut(SmartPointer gg, double lambda) ; ///< Standard constructor + PolishDoughnut(const PolishDoughnut& ) ; ///< Copy constructor + virtual PolishDoughnut* clone() const; + virtual ~PolishDoughnut() ; ///< Destructor + + + // Mutators / assignment + // --------------------- +public: + /// Assignment to another PolishDoughnut + void operator=(const PolishDoughnut&) ; + + // Accessors + // --------- +public: + double getL0() const; ///< Get PolishDoughnut::l0_ + // void setL0(double l0); set by lambda_ + + double getLambda() const; ///< Get PolishDoughnut::lambda_ + void setLambda(double lambda); ///< Set PolishDoughnut::lambda_ + + double getTemperatureRatio() const; ///< Get PolishDoughnut::temperature_ratio_ + void setTemperatureRatio(double temp); ///< Set PolishDoughnut::temperature_ratio_ + + double getCentralDensity() const; ///< Get PolishDoughnut::central_density_ + double getCentralDensity(std::string unit) const; ///< Get PolishDoughnut::central_density_ in specified unit + void setCentralDensity(double density); ///< Set PolishDoughnut::central_density_ + void setCentralDensity(double density, std::string unit); ///< Set PolishDoughnut::central_density_ in specified unit + + double getCentralTempOverVirial() const; ///< Get PolishDoughnut::centraltemp_over_virial_ + void setCentralTempOverVirial(double val); ///< Set PolishDoughnut::centraltemp_over_virial_ + + double getBeta() const; ///< Get PolishDoughnut::beta_ + void setBeta(double beta);///< Set PolishDoughnut::beta_ + + void setSpectralOversampling(size_t); ///< Set PolishDoughnut::spectral_oversampling_ + size_t getSpectralOversampling() const ; ///< Get PolishDoughnut::spectral_oversampling_ + + // Read only members, depend on lambda + double getWsurface() const; ///< Get PolishDoughnut::W_surface_ + double getWcentre() const; ///< Get PolishDoughnut::W_centre_ + double getRcusp() const; ///< Get PolishDoughnut::r_cusp_ + double getRcentre() const; ///< Get PolishDoughnut::r_centre_ + + + virtual Gyoto::SmartPointer getMetric() const; + virtual void setMetric(Gyoto::SmartPointer); + void useSpecificImpact(int yes=1); ///< Set PolishDoughnut::use_specific_impact_ + + // ASTROBJ API + // ----------- + /** + * Depending on PolishDoughnut::use_specific_impact_. See useSpecificImpact(). + */ + int Impact(Photon *ph, size_t index, + Astrobj::Properties *data); + ///< Call either PolishDoughnut::Impact() or Standard::Impact() + + /** + * This should not be better than Standard::Impact(). Call + * useSpecificImpact() or Set <UseSpecifictImpact/> in the XML + * file to use it. + */ + int Impact_(Photon *ph, size_t index, + Astrobj::Properties *data); + ///< A specific implementation of Generic::Impact() + virtual double operator()(double const coord[4]) ; + + virtual int setParameter(std::string name, + std::string content, + std::string unit) ; +#ifdef GYOTO_USE_XERCES + virtual void fillElement(FactoryMessenger *fmp) const ; +#endif + + // ASTROBJ processHitQuantities API + // -------------------------------- +protected: + /** + * \brief Update PolishDoughnut::aa_ + * + * See Hook::Listener::tell(). + */ + virtual void tell(Gyoto::Hook::Teller * msg); + virtual void getVelocity(double const pos[4], double vel[4]) ; + using Standard::integrateEmission; + + /** + * \brief ∫ν1ν2 Iν dν (or jν) + * + * PolishDought::emission() is slow. Integrating it is very + * slow. This implementation simply oversamples the spectrum by + * PolishDoughnut::spectral_oversampling_ and sums the trapezoids. + * + * For general documentation, see Astrobj::Generic::integrateEmission(double * I, double const * boundaries, size_t const * chaninds, size_t nbnu, double dsem, double *cph, double *co) const . + */ + virtual void integrateEmission(double * I, double * boundaries, + size_t* chaninds, size_t nbnu, + double dsem, double *cph, double *co) const; + + virtual double emission(double nu_em, double dsem, double coord_ph[8], + double coord_obj[8]) const; + virtual void emission(double Inu[], double nu_em[], size_t nbnu, + double dsem, double coord_ph[8], + double coord_obj[8]=NULL) const ; + + double emissionBrems(double nu_em, double nu_crit, + double numax, double T_electron, + double n_e, double n_j, + double amplification, + double Cbrems, + int comptonorder) const; + ///< Bremsstrahlung proxy for emission() + double emissionSynch(double nu_em, double nu_crit, + double numax, double nu_0, + double T_electron, + double amplification, + double Csynch, + double alpha1, double alpha2, + double alpha3, double preff, + int comptonorder) const; + ///< Synchrotron proxy for emission() + double transmission(double nuem, double dsem, double coord_ph[8]) const ; + double BBapprox(double nuem, double Te) const; ///< Approximated Black-Body function + static double funcxM(double alpha1, double alpha2, double alpha3, double xM); + ///< Mahadevan 96 fit function + // PURELY INTERNAL TO ASTROBJ + // -------------------------- +private: + double potential(double r, double theta) const; + ///< Potential defining shape, used by operator()() + + /** + * \class Gyoto::Astrobj::PolishDoughnut::intersection_t + * \brief double intersection(double) Functor class + * + * Implement former double intersection(double) function as a + * Gyoto::Functor::Double_Double_const subclass to access generic + * root-finding methods. + * + * This class is instanciated in a single + * PolishDoughnut::intersection member. + */ + class intersection_t : public Gyoto::Functor::Double_Double_const { + public: + double aa_; ///< Metric spin + double aa2_;///< aa_2 + double l0_; ///< Torus angular momentum + virtual double operator() (double) const; + }; + /** + * \class Gyoto::Astrobj::PolishDoughnut::transcendental_t + * \brief double transcendental(double) Functor class + * + * Implement former double transcendental(double, double*) function + * as a Gyoto::Functor::Double_Double_const subclass to access + * generic root-finding methods. + * + * This class is as a local variable in PolishDoughnut::emission() + */ + class transcendental_t : public Gyoto::Functor::Double_Double_const { + public: + /** + * \brief Parameter array + * + * \code + * double rr = par[0] ; + * double n_e = par[1] ; + * double BB = par[2] ; + * double Te = par[3] ; + * double alpha1 = par[4] ; + * double alpha2 = par[5] ; + * double alpha3 = par[6] ; + * \endcode + */ + double const * par; + virtual double operator() (double) const; + }; + intersection_t intersection; ///< double intersection(double) Functor + + public: + static double bessi0(double xx);///< Modified Bessel function I0 + static double bessi1(double xx);///< Modified Bessel function I1 + static double bessk0(double xx);///< Modified Bessel function K0 + static double bessk1(double xx);///< Modified Bessel function K1 + static double bessk(int nn, double xx);///< Modified Bessel function + + // Outputs + // ------- + public: + + /// Display + friend std::ostream& operator<<(std::ostream& , const PolishDoughnut& ) ; + + public: + + +}; + +#endif diff -Nru gyoto-0.0.3/include/GyotoPowerLawSpectrum.h gyoto-0.1.0/include/GyotoPowerLawSpectrum.h --- gyoto-0.0.3/include/GyotoPowerLawSpectrum.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoPowerLawSpectrum.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,12 +1,12 @@ /** * \file GyotoPowerLawSpectrum.h - * \brief A constant spectrum : I_nu=cst + * \brief A power law spectrum : I_nu=constant_*nu^exponent_ * * Light emitted by an astronomical object */ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -37,51 +37,49 @@ /** * \class Gyoto::Spectrum::PowerLaw - * \brief I_nu=cst + * \brief I_nu=constant_*nu^exponent_ * - * Light emitted by e.g. a Star + * Light emitted by e.g. a Star. * + * XML stanza: + * \code + * + * 0. + * 1. + * + * \endcode */ class Gyoto::Spectrum::PowerLaw : public Gyoto::Spectrum::Generic { friend class Gyoto::SmartPointer; protected: - double constant_; - double exponent_; + double constant_; ///< I_nu=constant_*nu^exponent_ + double exponent_; ///< I_nu=constant_*nu^exponent_ public: PowerLaw(); + + /** + * \brief Constructor setting exponent_ and optionally constant_ + */ PowerLaw(double exponent, double constant=1.); // PowerLaw(const Spectrum &); virtual PowerLaw * clone() const; ///< Cloner - double getConstant() const; ///< Get constant - void setConstant(double); - double getExponent() const; ///< Get exponent - void setExponent(double); + double getConstant() const; ///< Get constant_ + void setConstant(double); ///< Set constant_ + double getExponent() const; ///< Get exponent_ + void setExponent(double); ///< Set exponent_ using Gyoto::Spectrum::Generic::operator(); virtual double operator()(double nu) const; - ///< I_nu = mySpectrum(nu), nu in Hz #ifdef GYOTO_USE_XERCES - /** - * Spectrum implementations should impement fillElement to save their - * parameters to XML and call the generic implementation to save - * generic parts. - */ + virtual void setParameter(std::string name, + std::string content, + std::string unit); virtual void fillElement(FactoryMessenger *fmp) const ; - ///< called from Factory #endif }; -#ifdef GYOTO_USE_XERCES -namespace Gyoto { - namespace Spectrum { - Gyoto::SmartPointer - PowerLawSubcontractor(Gyoto::FactoryMessenger* fmp = NULL); - void PowerLawInit(); - } -} -#endif #endif diff -Nru gyoto-0.0.3/include/GyotoRegister.h gyoto-0.1.0/include/GyotoRegister.h --- gyoto-0.0.3/include/GyotoRegister.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoRegister.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,6 +1,5 @@ -#ifdef GYOTO_USE_XERCES /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -22,30 +21,111 @@ #define __GyotoRegister_H_ #include -#include +#include "GyotoSmartPointer.h" + +/** + * \file GyotoRegister.h + * \brief Gyoto registers + * + * Gyoto::Register::Entry instances are used to map kind names to + * Gyoto::SmartPointee::Subcontractor_t functions used to instanciate + * objects from XML files through the Gyoto::Factory. + */ namespace Gyoto { +#ifdef GYOTO_USE_XERCES + /** + * \namespace Gyoto::Register + * \brief Gyoto registers + * + * Gyoto::Register::Entry instances are used to map kind names to + * Gyoto::SmartPointee::Subcontractor_t functions used to + * instanciate objects from XML files through the Gyoto::Factory. + */ namespace Register { + + /* Documented below */ class Entry; + + /** + * \brief Initialise the various registers + * + * Normally called once at application start-up, Register::init() + * initiaizes the registers, loads the plug-ins, and fills the + * registers as appropriate. + * + * \param pluglist Coma-separated list of plug-ins to load. If + * NULL, default to the environment variable GYOTO_PLUGINS, if it + * exists. Else use GYOTO_DEFAULT_PLUGINS. Failing to load a + * plug-in prepended with "nofail:" is not fatal. + */ void init( char const * pluglist = NULL ); + + /** + * \brief List the various registers + */ void list(); } +#endif + + /** + * \brief Load a plugin by name + * + * Uses dlopen to load the file libgyoto-<plugname>.so, looks for + * the function __Gyoto<plugname>Init inside it and run it. + * Plug-ins must be located in the runtime link search path, or in + * GYOTO_PREFIX/lib/gyoto/, or in + * GYOTO_PREFIX/lib/gyoto/GYOTO_SOVERS/. + * + * \param plugname Plug-in name. + * \param nofail Unless nofail evals to true, the inability to find + * a plug-in or to run the initialization function inside it throws + * an Gyoto::Error. + */ void loadPlugin( char const * const plugname, int nofail = 0); } +#ifdef GYOTO_USE_XERCES +/** + * \brief Entry in a register (or a full register) + * + * A register is actually a chained list of Register::Entry + * instances. + */ class Gyoto::Register::Entry { - friend void Register::list (); + /** + * \brief List the various registers + */ + friend void Gyoto::Register::list(); protected: std::string name_; + ///< Kind name for the entry, as found in the "kind" XML attribute Gyoto::SmartPointee::Subcontractor_t* subcontractor_; - int type_; + ///< Pointer to the Gyoto::SmartPointee::Subcontractor_t function that produces an object of this kind Register::Entry* next_; + ///< Next entry in the register, or NULL public: + /** + * \brief Constructor + */ Entry(std::string name, Gyoto::SmartPointee::Subcontractor_t* subcontractor, Entry* next); - ~Entry(); - Gyoto::SmartPointee::Subcontractor_t* getSubcontractor(std::string); + ~Entry(); ///< Destructor + + /** + * \brief Get subcontractor for a given name + * + * Search through the register for an Entry matching name and return + * the corresponding subcontractor. + * + * \param name Name of the kind to look for. + * \param errmode 1 if getSubContractor() should return NULL upon + * failure. Else a Gyoto::Error is thrown. + * \return Pointer to subcontractor function. + */ + Gyoto::SmartPointee::Subcontractor_t* + getSubcontractor(std::string name, int errmode=0); }; #endif diff -Nru gyoto-0.0.3/include/GyotoRotStar3_1.h gyoto-0.1.0/include/GyotoRotStar3_1.h --- gyoto-0.0.3/include/GyotoRotStar3_1.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoRotStar3_1.h 2013-07-27 09:14:20.000000000 +0000 @@ -53,36 +53,69 @@ friend class Gyoto::SmartPointer; private: - char* filename_; - Star_rot * star_; - int integ_kind_;//1 if RotStar3_1::myrk4, 0 if Metric::myrk4 + char* filename_; ///< Lorene output file name + Star_rot * star_; ///< Pointer to underlying Lorene Star_rot instance + int integ_kind_;///< 1 if RotStar3_1::myrk4(), 0 if Metric::myrk4() public: - RotStar3_1(const char * lorene_res, const int integ_kind); ///< Constructor + RotStar3_1(); ///< Constructor + RotStar3_1(const RotStar3_1& ) ; ///< Copy constructor virtual ~RotStar3_1() ; ///< Destructor virtual RotStar3_1* clone() const ; ///< Cloner (uses RotStar3_1(file, integ_kind)) - char const * const getFileName() const; + void setFileName(char const *); ///< Set filename_ + char const * getFileName() const; ///< Get filename_ - int getIntegKind() const ; + void setIntegKind(int); ///< Set integ_kind_ + int getIntegKind() const ; ///< Get integ_kind_ using Metric::Generic::myrk4; + + + /** + * \brief RK4 integrator + * + * NB: we use the 6-coordinates, here, unlike the inherited function. + */ + int myrk4(const double coord[6], double h, double res[6]) const; - //NB: there is no myrk4(const double coord[8], double h, double res[8]), which makes no pb because this same function is defined in class Metric where it is virtual but not pure. This myrk4(const double coord[6], double h, double res[6]) is a purely internal function, only called by RotStar3_1::myrk4_adaptive(const double coor[6],...) + /** + * \brief Adaptive RK4 integrator + * + * Dispatches between Generic::myrk4_adaptive() and myrk4_adaptive(const double coor[6], double lastnorm, double normref, double coornew[6], double cst[2], double& tdot_used, double h0, double& h1, double& hused) const depending on RotStar3_1::integ_kind_ + */ int myrk4_adaptive(Gyoto::Worldline* line, const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1) const; + /** + * \brief RK4 integrator (3+1) + * + * NB: we use the 6-coordinates, here, unlike the inherited function. + */ int myrk4_adaptive(const double coor[6], double lastnorm, double normref, double coornew[6], double cst[2], double& tdot_used, double h0, double& h1, double& hused) const; - /** F function such as dy/dtau=F(y,cst) + + /** + * \brief F function such as dy/dtau=F(y,cst) */ int diff(const double coord[8], double res[8]) const ; + + /** + * \brief Alternate version of diff(const double coord[8], double res[8]) const + * + * Using only 6 parameters. Last int is not used: it is only here to + * distinguish the signature of the two methods. Could have been + * done choosing another name, too, but hey... + */ int diff(const double y[6], double res[6], int) const ; - // NB: last int is just to distinguish with the other diff ; it doesn't seem to be possible to redefine diff with [8]->[6] - void Normalize4v(const double coordin[8], double coordout[8], const double cst[2], double& tdot_used) const; + + /** + * \brief Tweak coordinates to insure conservation of cst + */ + void Normalize4v(const double coordin[6], double coordout[6], const double cst[2], double& tdot_used) const; double gmunu(const double * x, int mu, int nu) const ; @@ -92,10 +125,10 @@ double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const ; + virtual void setParameter(std::string, std::string, std::string); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp); ///< called from Factory - static Metric::Subcontractor_t Subcontractor; - static void Init(); + virtual void setParameters(Gyoto::FactoryMessenger *fmp) ; #endif }; diff -Nru gyoto-0.0.3/include/GyotoScenery.h gyoto-0.1.0/include/GyotoScenery.h --- gyoto-0.0.3/include/GyotoScenery.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoScenery.h 2013-07-27 09:14:20.000000000 +0000 @@ -2,7 +2,7 @@ * \file GyotoScenery.h * \brief Ray-tracing framework * - * A Metric, an Astrobj and a screen. + * A Metric, an Astrobj and a Screen. */ /* @@ -37,6 +37,7 @@ #include #include #include +#include /** * \class Gyoto::Scenery @@ -64,8 +65,21 @@ * - FirstDistMin: last closest approach between Photon and Astrobj; * - Redshift; * - ImpactCoords: 8-coordinates of the object and photon at impact; - * - Spectrum: I_{nu} computed at various values frequencies, + * - Spectrum: Iν computed at various values frequencies, * corresponding to the Screen's Spectrometer. + * - BinSpectrum: + * ∫ν1ν2Iνdν + * computed between various (ν1, ν2 + * pairs corresponding to the Screen's Spectrometer. This is what a + * physical spectrometer measures. + * + * In addition, it is possible to ray-trace an image using several + * cores on a single machine (if Gyoto has been compiled with POSIX + * threads support). The number of threads can be specified using + * NThreads entity. Setting NThreads to 0 is equivalent to setting it + * to 1. Beware that setting NThreads to a number higher than the + * actual number of cores available on the machine usually leads to a + * decrease in performance. * * Thus a fully populated Scenery XML looks like that: * \code @@ -88,6 +102,8 @@ * * 1. * + * 2 + * * * \endcode */ @@ -113,30 +129,53 @@ */ SmartPointer obj_; + bool adaptive_; ///< Whether integration should use adaptive delta + /** * Default integration step for the photons */ double delta_; // default integration step for the photons + /// Quantities to compute /** - * The list of quantities that will be computed, for instance: + * Bitwise OR of quantities that will be computed, for instance: + * \code * GYOTO_QUANTITY_INTENSITY | GYOTO_QUANTITY_EMISSIONTIME | ... + * \endcode */ Gyoto::Quantity_t quantities_; /** * Used internally to not always reallocate memory when operator() is called. */ - Gyoto::Photon ph_; ///< a Photon. + Gyoto::Photon ph_; ///< Cached Photon. /** - * Computation does not go back before tlim_. Default is 0. tlim_ is - * always expressed in geometrical units, it is essentially a tunig - * parameter for the ray-tracing process. tlim should be chosen to + * Computation does not go back before tmin_. Default is -DBL_MAX. tmin_ is + * always expressed in geometrical units, it is essentially a tuning + * parameter for the ray-tracing process. tmin should be chosen to * always be longer than the distance between the screen and the * object. */ - double tlim_; ///< Time limit for the integration (geometrical units) + double tmin_; ///< Time limit for the integration (geometrical units) + + /** + * When compiled with libpthread, Scenery::rayTrace() may compute + * several points of the image in parallel threads. This is the + * number of threads to use. + */ + size_t nthreads_; ///< Number of parallel threads to use in rayTrace() + +# ifdef HAVE_UDUNITS + /// See Astrobj::Properties::intensity_converter_ + Gyoto::SmartPointer intensity_converter_; + /// See Astrobj::Properties::intensity_converter_ + Gyoto::SmartPointer spectrum_converter_; + /// See Astrobj::Properties::intensity_converter_ + Gyoto::SmartPointer binspectrum_converter_; +# endif + + size_t maxiter_ ; ///< Maximum number of iterations when integrating // Constructors - Destructor // ------------------------- @@ -145,9 +184,10 @@ Scenery (const Scenery& o); ///< Copy constructor Scenery * clone() const; ///< Cloner + /// Constructor setting Scenery::gg_, Scenery::screen_, and Scenery::obj_ /** * To ensure consistency, the Metric will be forcibly attached to - * the Screen and to the Astrobj. + * the Screen and to the Astrobj (if they are not NULL). */ Scenery(SmartPointer, SmartPointer, SmartPointer); @@ -158,53 +198,156 @@ public: // Accessors // --------- - SmartPointer getMetric(); ///< Get Metric + SmartPointer getMetric(); ///< Get Scenery::gg_ /** * The provided Metric will also be atached to the Screen and the Astrobj. */ - void setMetric(SmartPointer); ///< Set Metric - SmartPointer getScreen(); ///< Get Screen object + void setMetric(SmartPointer); ///< Set Scenery::gg_ + SmartPointer getScreen(); ///< Get Scenery::screen_ /** * The Metric attached to the Scenery will be attached to the Screen */ - void setScreen(SmartPointer);///< Set screen object - SmartPointer getAstrobj(); + void setScreen(SmartPointer);///< Set Scenery::screen_ + SmartPointer getAstrobj(); ///< Get Scenery::obj_ /** * The Metric attached to the Scenery will be attached to the Astrobj */ - void setAstrobj(SmartPointer); - double getDelta() const ; - void setDelta(double); + void setAstrobj(SmartPointer); ///< Set Scenery::obj_ + double getDelta() const ; ///< Get default step in geometrical units + double getDelta(const std::string &unit) const ; ///< Get default step in specified units + void setDelta(double); ///< set default step in geometrical units + void setDelta(double, const std::string &unit); ///< set default step in specified units + + /// Set Scenery::quantities_ + /** + * \param quant Bitwise OR of desired quantities, e.g. \code GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_MIN_DISTANCE \endcode + */ + void setRequestedQuantities(Quantity_t quant) ; + + /// Set Scenery::quantities_ from string + /** + * \param squant Coma-separated list of quantities, e.g. "Spectrum + * MinDistance". The order is not relevant. + */ + void setRequestedQuantities(std::string squant) ; - void setRequestedQuantities(Quantity_t) ; - void setRequestedQuantities(std::string) ; + /// Get Scenery::quantities_ Quantity_t getRequestedQuantities() const ; + + /// Get a string representation of Scenery::quantities_ std::string getRequestedQuantitiesString() const ; + + /// Get number of requested quantities of scalar nature + /** + * This is all quantities except Spectrum, BinSpectrum and ImpactCoords. + */ size_t getScalarQuantitiesCount() const ; - void setTlim(double); ///< set tlim_; - double getTlim() const ;///< get tlim_ + /// Get Scenery::tmin_ + double getTmin() const ; + /// Get Scenery::tmin_ in specified unit + double getTmin(const std::string &unit) const ; + /// Set Scenery::tmin_ + void setTmin(double); + /// Set Scenery::tmin_ in specified unit + void setTmin(double, const std::string &unit); + + void adaptive (bool mode) ; ///< Set Scenery::adaptive_ + bool adaptive () const ; ///< Get Scenery::adaptive_ + + void maxiter (size_t miter) ; ///< Set Scenery::maxiter_ + size_t maxiter () const ; ///< Get Scenery::maxiter_ + + void setNThreads(size_t); ///< Set nthreads_; + size_t getNThreads() const ; ///< Get nthreads_; + + /// Set Scenery::intensity_converter_ + void setIntensityConverter(std::string unit); + /// Set Scenery::spectrum_converter_ + void setSpectrumConverter(std::string unit); + /// Set Scenery::binspectrum_converter_ + void setBinSpectrumConverter(std::string unit); + + /// Copy converters to Astrobj::Properties instance + /** + * Copy Scenery::intensity_converter_, Scenery::spectrum_converter_ + * and Scenery::binspectrum_converter_ to there alter ego in *prop. + */ + void setPropertyConverters(Gyoto::Astrobj::Properties *prop); // Worker: public: + /// Perform ray-tracing for a square area on Screen + /** + * For each Scenery::screen_ pixel in the square area limited by + * imin, imax, jmin and jmax, launch a Photon back in time to + * compute the various quantities. + * + * At this time, the computed quantities depend on on the pointers + * in *data which are not NULL. + * + * rayTrace() uses + * - setPropertyConverters() to set the converters in *data; + * - Astrobj::Properties::init() to initialize each cell in *data; + * - Astrobj::Properties::operator++() to step through the arrays in *data. + * + * data must have been instanciated prior to calling rayTrace and + * the various pointers in *data must be NULL or point to the first + * cell in an array of size at least Screen::npix_ squared. + * + * If Scenery::nthreads_ is ≥2 and Gyoto has been compiled with + * pthreads support, rayTrace() will use Scenery::nthreads_ threads + * and launch photons in parallel. This works only if the + * Astrobj::Generic::clone() and Metric::Generic::clone() methods + * have been properly implemented for the specific astrobj and + * metric kind, and if they are both thread-safe. At the moment, + * unfortunately, Lorene metrics are known to not be thread-safe. + * + * \param[in] imin, imax, jmin, jmax First and last rows and columns in + * Scenery::screen_ to compute + + * \param[in, out] data Pointer to a preallocated + * Astrobj::Properties instance which sets which quantities must be + * computed and where to store the output. + * + * \param[in] impactcoords Optional pointer to an array of + * pre-computed impact coordinates. If impactcoords is provided, + * rayTracing is skipped and the quantities in *data are fill + * assuming that the impact coordinates are correct. This only makes + * sense in optically thick mode, when ray-tracing several sceneries + * for which the shape of the object is identical but their emission + * distributions are not. impactcoords can be computed using the + * ImpactCoords quantity. + */ void rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax, Astrobj::Properties* data, double * impactcoords = NULL); + + /// Ray-trace a single pixel in Scenery::screen_ + /** + * Almost identical to rayTrace(), but for a single pixel. + * + * If ph is passed, it is assumed to have been properly initialized + * (with the right metric and astrobj etc.) already. Else, use + * &Scenery::ph_. + */ void operator() (size_t i, size_t j, Astrobj::Properties *data, - double * impactcoords = NULL); + double * impactcoords = NULL, Photon * ph = NULL); #ifdef GYOTO_USE_XERCES public: - void fillElement(FactoryMessenger *fmp); ///< called from Factory + /// Fill XML section + /** + * Akin to Astrobj::Generic::fillElement or + * Metric::Generic::fillElement for instance. + */ + void fillElement(FactoryMessenger *fmp); + /// Instanciate Scenery from an XML description. + static SmartPointer Subcontractor(Gyoto::FactoryMessenger*); + #endif }; -#ifdef GYOTO_USE_XERCES -namespace Gyoto { - SmartPointer ScenerySubcontractor(Gyoto::FactoryMessenger*); -} -#endif - #endif diff -Nru gyoto-0.0.3/include/GyotoScreen.h gyoto-0.1.0/include/GyotoScreen.h --- gyoto-0.0.3/include/GyotoScreen.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoScreen.h 2013-07-27 09:14:20.000000000 +0000 @@ -5,7 +5,7 @@ */ /* - Copyright 2011 Thibaut Paumard, Frederic Vincent + Copyright 2011-2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. @@ -60,24 +60,14 @@ * - the field-of-view of the image; * - the resolution of the camera: number of pixels on each side * (the camera is square); - * - a description of the Spectrometer. + * - the observing frequency. * - * The Spectrometer defines for which frequencies spectra are computed - * (when the Quantity Spectrum is requested in the Scenery). The - * frequency axis can be linear in frequency or in wavelength, or - * logarithmic in frequency or in wavelength. The spectrometr is thus - * defines by: - * - a kind: one of "none", "freqlog", "freq", "wavelog" or "wave"; - * - a number of spectral channels; - * - the boundaries of the spectral band. - * - * Each spectral channel will be of equal width in the space specified - * by the kind of the Spectrometer. The boundaries are specified in Hz - * for a "freq" Spectrometer, in Log(Hz) for freqlog, in meters for wave - * and Log(meter) for wavelog. The boundaries correspond to the extremum - * boundaries of the outermost spectral channels. When computing the - * Quantity "Spectrum", the frequency considered is the midpoint of - * each spectral channel. + * The scalar FreqObs defines the observing frequency for Scenery + * quantity Intensity. + * + * Likewise, a Gyoto::Spectrometer defines for which frequencies + * spectra are computed (when the Quantity Spectrum is requested in + * the Scenery). * * For the sake of theoreticians, there is an alternate way of * specifying the relative position of the Screen and Metric, by @@ -88,14 +78,15 @@ * So an XML stanza for a Screen may look like that: * \code * - * + * * 0.3141592653589793 - * 128 - * 1e30 + * 128 + * 1e30 * 3.14159 - * 2.0944 - * -2.0944 + * 2.0944 + * -2.0944 * 17. 23. + * 1e20 * * \endcode * @@ -107,6 +98,7 @@ * 0.3141592653589793 * 128 * 17. 23. + * 1e20 * * \endcode * @@ -116,11 +108,12 @@ * * \code * 8 - * \endcode. + * \endcode * - * The possible units are (with [] noting the default): + * Possible units are (with [] noting the default): * - distance: [m], geometrical, cm, km, AU, ly, pc, kpc, Mpc; * - PALN, inclination, argument: [rad], deg. + * - frequency: [Hz], µm, GeV... * * When the distance is really large and most of the ray-tracing would * happen de facto in flat space, the camera is transported to a @@ -132,7 +125,7 @@ * * \code * 8 - * \encode + * \endcode * * Symptoms when dmax is too large include pixelization of the image * (neighbouring photons are numerically identical) and other @@ -150,10 +143,12 @@ double tobs_; ///< Observing date in s double fov_; ///< Field-of-view in rad // double tmin_; - size_t npix_; ///< resolution in pixels + size_t npix_; ///< Resolution in pixels double distance_; ///< Distance to the observer in m double dmax_; ///< Maximum distance from which the photons are launched (geometrical units) + + int anglekind_; ///< Screen angles kind (0: equatorial, 1: spherical) /** * The angles are position angle of the line of nodes (North of @@ -165,9 +160,26 @@ double ey_[3]; ///< Sky coordinate of base Y vector double ez_[3]; ///< Sky coordinate of base Z vector - SmartPointer gg_; ///< Metric in which the screen is placed ; necessary for unitLength + double fourvel_[4]; ///< Observer's 4-velocity + double screen1_[4]; ///< Screen e1 vector + double screen2_[4]; ///< Screen e2 vector + double screen3_[4]; ///< Screen e3 vector (normal) + + double alpha0_; ///< Screen orientation (0,0) is right towards the BH + double delta0_; ///< Screen orientation (0,0) is right towards the BH + SmartPointer gg_; ///< The Metric in this end of the Universe - SmartPointer spectro_; + /** + * \brief Gyoto::Spectrometer::Generic subclass instance used for quantities Spectrum and BinSpectrum + */ + SmartPointer spectro_; + + /** + * \brief Frequency at which the observer observes + * + * For the quantity Intensity + */ + double freq_obs_; public: @@ -192,29 +204,78 @@ const double inclination, const double argument); + /// Set distance from observer /** - * \param dist the distance in meters. + * \param dist Distance in meters. */ - void setDistance(double dist); ///< Set distance from observer - void setDmax(double dist); ///< Set ray-tracing maximum distance + void setDistance(double dist); + + /// Set ray-tracing maximum distance + /** + * \param dist Distance in geometrical units. + */ + void setDmax(double dist); + + /// Set distance from observer /** * \param dist the distance expressed in the specified unit; - * \param unit one of: [m], geometrical, cm, km, sunradius, AU, ly, - * pc, kpc, Mpc. + * \param unit convertible to meters */ void setDistance(double dist, const std::string unit); - ///< Set distance from observer + + /// Set inclination relative to line-of-sight + /** + * Inclination of z-axis relative to line-of-sight, or inclination + * of equatorial plane relative to plane of the sky, in radians + */ void setInclination(double); - ///< Set inclination relative to line-of-sight + + /// Set inclination relative to line-of-sight + /** + * Inclination of z-axis relative to line-of-sight, or inclination + * of equatorial plane relative to plane of the sky, in specified unit. + */ void setInclination(double, const std::string &unit); + void setPALN(double); ///< Set position angle of the line of nodes void setPALN(double, const std::string &unit); + ///< Set position angle of the line of nodes void setArgument(double); ///< Set angle beetwen line of nodes and X axis of object void setArgument(double, const std::string &unit); - void setSpectrometer(SmartPointer spectro); - SmartPointer getSpectrometer() const ; + ///< Set angle beetwen line of nodes and X axis of object + void setSpectrometer(SmartPointer spectro); + ///< Set Screen::spectro_ + SmartPointer getSpectrometer() const ; + ///< Get Screen::spectro_ + + /** + * \brief Set freq_obs_ + * \param fo double: observing frequency in Hz + */ + void setFreqObs(double fo); + + + /** + * \brief Set freq_obs_ + * \param fo double: observing frequency (or wavelength) in "unit" + * \param unit string: unit in which fo is expressed, convertable to + * Herz or meters or energy. + */ + void setFreqObs(double fo, const std::string &unit); + + /** + * \brief Get freq_obs_. + */ + double getFreqObs() const ; + + /** + * \brief Get freq_obs_. + * \param unit string: unit in which freq_obs_ should be returned is + * expressed, convertable to Herz or meters or energy. + */ + double getFreqObs(const std::string &unit) const; /// Alternative way to set projection /** @@ -222,66 +283,165 @@ * parameters change the observer's coordinates. For observationnal * ray-tracing purposes, prefer setProjection(). * - * \param pos[4] position of observer in Screen's coordinate system - * \param sys coordinate system used for pos + * \param[in] pos position of observer in Screen's coordinate + * system. Content is copied. */ void setObserverPos(const double pos[4]); - ///< Sets the orientation of Screen relative to observer + + void setFourVel(const double coord[4]); + ///< Sets the observer's 4-velocity + void setScreen1(const double coord[4]); + ///< Sets the screen vector e1 + void setScreen2(const double coord[4]); + ///< Sets the screen vector e2 + void setScreen3(const double coord[4]); + ///< Sets the screen vector e3 (normal) // Accessors // --------- - int getCoordKind() const; ///< Get coordinate kind - double getDistance() const; ///< Get distance from observer - double getDmax() const; ///< Get maximum ray-tracing distance - double getInclination() const; ///< Get inclination relative to line-of-sight - double getPALN() const; ///< Get position angle of the line of nodes - double getArgument() const; ///< Get angle beetwen line of nodes and X axis of object + /// Get coordinate kind + /** + * From Screen::gg_. + */ + int getCoordKind() const; + + /// Get distance from observer + /** + * In meters. + */ + double getDistance() const; + + /// Get distance from observer + /** + * In specified unit. + */ + double getDistance(const std::string&) const; ///< Get distance from observer + + /// Get maximum ray-tracing distance + /** + * In geometrical units. + */ + double getDmax() const; + /// Get inclination relative to line-of-sight + /** + * Inclination of z-axis relative to line-of-sight, or inclination + * of equatorial plane relative to plane of the sky, in radians. + */ + double getInclination() const; - SmartPointer getMetric() const; ///< Get gg_; - void setMetric(SmartPointer gg); + /// Get inclination relative to line-of-sight + /** + * Inclination of z-axis relative to line-of-sight, or inclination + * of equatorial plane relative to plane of the sky, in specified unit. + */ + double getInclination(const std::string&) const; + + double getPALN() const; ///< Get position angle of the line of nodes + double getPALN(const std::string&) const; ///< Get position angle of the line of nodes + double getArgument() const; ///< Get angle between line of nodes and X axis of object + double getArgument(const std::string&) const; ///< Get angle between line of nodes and X axis of object + SmartPointer getMetric() const; ///< Get Screen::gg_ + void setMetric(SmartPointer gg); ///< Set Screen::gg_ + + /// Get observing date in seconds double getTime(); + + /// Get observing date in seconds + double getTime(const std::string &); + + /// Set observing date in specified unit void setTime(double, const std::string &); + + /// Set observing date in seconds void setTime(double); - // double getMinimumTime(); - // void setMinimumTime(double); + + /// Get Screen::fov_ in radians double getFieldOfView(); + + /// Get Screen::fov_ in specified unit + double getFieldOfView(std::string unit); + + /// Set Screen::fov_ in radians void setFieldOfView(double); + + /// Set Screen::fov_ in specified unit void setFieldOfView(double, const std::string &unit); + + /// Set direction of the line-of-view + void setAlpha0(double); + /// Set direction of the line-of-view + void setDelta0(double); + + /// Set Screen::anglekind_ + void setAnglekind(int); + + /// Get Screen::npix_ size_t getResolution(); + /// Set Screen::npix_ void setResolution(size_t); - + /// 4-Position of the observer relative to the metric /** - *A Screen is positioned relative to the observer with four elements: + * A Screen is positioned relative to the observer with four elements: * Screen::distance, Screen::inclination, Screen::paln and * Screen::argument. * * This function returns the position of the observer relative to - * the Screen, using these parameters. The output parameter is - * coord. - * - * \param tobs observing time; - * \param coord[4] output: position of the observer; + * the metric system in Screen::gg_, using these parameters. The + * output parameter is coord. * + * \param[out] coord position of the observer. Must be preallocated. */ void getObserverPos(double coord[]) const; - ///< 4-Position of the observer relative to the Screen - + /// Get copy of Screen::fourvel_ + /** + * \param[out] fourvel preallocated 4-element array + */ + void getFourVel(double fourvel[]) const; + + /// Get copy of Screen::screen1_ + /** + * \param[out] output preallocated 4-element array + */ + void getScreen1(double output[]) const; + + /// Get copy of Screen::screen2_ + /** + * \param[out] output preallocated 4-element array + */ + void getScreen2(double output[]) const; + + /// Get copy of Screen::screen3_ + /** + * \param[out] output preallocated 4-element array + */ + void getScreen3(double output[]) const; + + /// Get 8-coordinate of Photon hitting screen from a given direction /** * Similar to Screen::getObserverPos() but will return in addition * the 4-velocity of a photon corresponding to the sky direction * given by x and y. - * \param tobs observing time; - * \param x RA (d_alpha*cos(delta)) offset in radians; - * \param y Dec offset (d_delta) in radians; - * \param coord[8] output: position-velocity of the observer in system sys; + * \param[in] x RA (d_alpha*cos(delta)) offset in radians; + * \param[in] y Dec offset (d_delta) in radians; + * \param[out] coord position-velocity of the observer Photon. Preallocated. * */ void getRayCoord(double x, double y, double coord[]) const; + + /// Get 8-coordinate of Photon hitting screen pixel + /** + * Similar to Screen::getObserverPos() but will return in addition + * the 4-velocity of a photon corresponding to the sky direction + * given by x and y. + * \param[in] i, j pixel coordinates + * \param[out] coord position-velocity of the Photon. Preallocated. + * + */ void getRayCoord(const size_t i, const size_t j, double coord[]) const; void coordToSky(const double pos[4], double skypos[3]) const; @@ -293,17 +453,36 @@ void computeBaseVectors() ; ///< Compute base vectors according to projection parameters + /// Display + // friend std::ostream& operator<<(std::ostream& , const Screen& ) ; + std::ostream& print(std::ostream&) const ; ///< Debug helper + std::ostream& printBaseVectors(std::ostream&) const ; ///< Debug helper + + // UDUNITS +# ifdef HAVE_UDUNITS + /// Map "pix" and "pixel" to angular pixel width in unit system + /** + * "pix" or "pixel" can then be used in units. + * + * There is only one unit system in Gyoto: "pix" can therefore be + * registered only for one Screen at a time. See Gyoto::Units. + * + * The unit must later be unmapped with unmapPixUnit(). + */ + void mapPixUnit(); + /// Unmap "pix" and "pixel" from unit system + /** + * See also mapPixUnit(). + */ + void unmapPixUnit(); +# endif - /// Display - friend std::ostream& operator<<(std::ostream& , const Screen& ) ; - std::ostream& print(std::ostream&) const ; - std::ostream& printBaseVectors(std::ostream&) const ; - #ifdef GYOTO_USE_XERCES public: void fillElement(FactoryMessenger *fmp); ///< called from Factory + /// Instanciate a Screen from XML entity static SmartPointer Subcontractor(FactoryMessenger* fmp); #endif diff -Nru gyoto-0.0.3/include/GyotoSmartPointer.h gyoto-0.1.0/include/GyotoSmartPointer.h --- gyoto-0.0.3/include/GyotoSmartPointer.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoSmartPointer.h 2013-07-27 09:14:20.000000000 +0000 @@ -9,8 +9,8 @@ referenced to only by SmartPointers. @code - class Gyoto::Metric : public Gyoto::SmartPointee {...} - SmartPointer ObjPtr (new Gyoto::Metric(...)) + class Gyoto::Metric : public Gyoto::SmartPointee {...}; + SmartPointer ObjPtr (new Gyoto::Metric(...)); @endcode @@ -39,6 +39,12 @@ #ifndef __GyotoSmartPointer_H_ #define __GyotoSmartPointer_H_ +#include "GyotoUtils.h" +#ifdef HAVE_PTHREAD +#include +#endif + + namespace Gyoto { class SmartPointee; class FactoryMessenger; @@ -46,7 +52,6 @@ } #include -#include #include #include #include @@ -67,8 +72,8 @@ * { * friend class Gyoto::SmartPointer; * ... - * } - * @endcode + * }; + * @endcode * */ class Gyoto::SmartPointee @@ -76,9 +81,16 @@ private: int refCount; ///< Reference counter. +# ifdef HAVE_PTHREAD + /** + * When compiled with libpthread + */ + pthread_mutex_t mutex_; ///< A mutex +#endif + public: SmartPointee () ; - SmartPointee (const SmartPointee&) ; + SmartPointee (const SmartPointee&) ; ///< Copy constructor void incRefCount () ; ///< Increment the reference counter. Warning: Don't mess with the counter. int decRefCount () ; ///< Decrement the reference counter and return current value. Warning: Don't mess with the counter. int getRefCount () ; ///< Get the current number of references @@ -104,7 +116,6 @@ /** - * \class Gyoto::SmartPointer * \brief Pointers performing reference counting * * Pointee must inherit from class SmartPointee. @@ -112,8 +123,10 @@ * To create an object and a SmartPointer pointing to it: * * \code - * SmartPointer ObjPtr (new Gyoto::Metric(...)) + * SmartPointer ObjPtr (new Gyoto::Metric(...)); * \endcode + * + * \tparam T Sub-class of Gyoto::SmartPointee. */ template< class T > class Gyoto::SmartPointer @@ -132,10 +145,9 @@ void decRef () { if (obj && obj->decRefCount() == 0) { - if (debug()) - std::cerr << "DEBUG: SmartPointer<" - << typeid(obj).name() - <<">::decRef(): delete " << obj << "\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(obj); +# endif delete obj; obj = NULL; } @@ -145,11 +157,11 @@ /** * \brief Constructor from a standard pointer-to-class * - * \param obj : a pointer to an instance of class T, created using new T(). + * \param orig : a pointer to an instance of class T, created using new T(). * * Example: * \code - * SmartPointer ObjPtr (new Gyoto::Metric(...)) // create SmartPointer ObjPtr + * SmartPointer ObjPtr (new Gyoto::Metric(...)); // create SmartPointer ObjPtr * \endcode */ SmartPointer (T *orig = NULL) : obj(orig) @@ -165,8 +177,8 @@ * * Example: * \code - * SmartPointer ObjPtr (new Gyoto::Metric(...)) // create SmartPointer ObjPtr - * SmartPointer ObjPtr2 = ObjPtr // create SmartPointer ObjPtr2 + * SmartPointer ObjPtr (new Gyoto::Metric(...)); // create SmartPointer ObjPtr + * SmartPointer ObjPtr2 = ObjPtr; // create SmartPointer ObjPtr2 * \endcode * * ObjPtr and ObjPtr2 point to the same instance of class T. Copying @@ -188,7 +200,7 @@ * an instance of the child class Gyoto::Kerr: * * \code - * SmartPointer KerrPtr (MetricPtr) + * SmartPointer KerrPtr (MetricPtr); * \endcode * * MetricPtr and KerrPtr point to the same instance of class @@ -239,6 +251,11 @@ return obj; } + /** + * \brief Dereference operator "->" (const) + * + * Access to the pointed-to-object's members. + */ T* operator-> () const { if (!obj) @@ -297,21 +314,23 @@ * \brief Cast SmartPointer to normal pointer */ // template operator U() { return obj; } - operator T*() { return obj; } + operator T*() const { return obj; } +#if 0 operator const T*() { return obj; } /** * \brief Check whether SmartPointer is valid * \return 0 if SmartPointer is NULL, 1 if valid. */ - operator bool () { return obj != NULL; } + operator bool () const { return obj != NULL; } /** * \brief Check whether SmartPointer is valid * \return 1 if SmartPointer is NULL, 0 if valid. */ bool operator! () const { return obj == NULL; } +#endif ~SmartPointer< T > () { decRef(); } diff -Nru gyoto-0.0.3/include/GyotoSpectrometer.h gyoto-0.1.0/include/GyotoSpectrometer.h --- gyoto-0.0.3/include/GyotoSpectrometer.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoSpectrometer.h 2013-07-27 09:14:20.000000000 +0000 @@ -6,7 +6,7 @@ * */ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -30,59 +30,396 @@ #include #include #include +#include #include +/** + * \namespace Gyoto::Spectrometer + * \brief Access to spectrometers + * + * Objects which describe spectrometers (including one-channel + * devices, a.k.a cameras) space-time geometry must inherit from the + * Gyoto::Spectrometer::Generic class. + * + * To be usable, a Spectrometer::Generic sub-class should register a + * Spectrometer::Subcontractor_t function using the Spectrometer::Register() + * function. See also \ref writing_plugins_page . + */ + namespace Gyoto{ - class Spectrometer; + namespace Spectrometer { + /** + * \class Gyoto::Spectrometer::Generic + * + * \brief Base class for spectrometers + * + * Example: class Gyoto::Spectrometer::Uniform + * + * See Gyoto::Spectrometer for an introduction. + * + * Generic inherits from Gyoto::SmartPointee so that it is + * possible to create a SmartPointer to a Spectrometer. + * + * It also inherits from Gyoto::Hook::Teller. This allows a + * consistent implementation of Spectrometer::Complex (in + * particular). Any method which mutates a Spectrometer should + * call tellListeners(). + */ + class Generic; + + /** + * \brief Type for Spectrometer kind + * + * Spectrometer kind is a unique numerical identifier for that kind, + * produced as the address to a static C string variable holding the + * kind's name. Most of the time, the address is the only + * significant part as this is more reliable and allows for direct + * numerical comparison instead of slower string comparison. The + * value of the string variable can be used for printing and as + * anchor name for Register(), although the anchor name could be + * different. + */ + typedef char const * kind_t; + +#if defined GYOTO_USE_XERCES + /** + * This is a more specific version of the + * SmartPointee::Subcontractor_t type. A Spectrometer::Subcontrator_t + * is called by the Gyoto::Factory to build an instance of the + * kind of spectrometer specified in an XML file (see + * Register()). The Factory and Subcontractor_t function + * communicate through a Gyoto::FactoryMessenger. + */ + typedef SmartPointer + Subcontractor_t(Gyoto::FactoryMessenger*); + ///< A function to build instances of a specific Astrobj::Generic sub-class + + /** + * \brief Query the Spectrometer register + * + * Get the Spectrometer::Subcontractor_t correspondig to a given + * kind name. This function is normally called only from the + * Gyoto::Factory. + * + * \param name Name of the subclass to build, e.g. "Complex" or "wave". + * \param errmode If name is not registered, getSubcontractor() return NULL + * errmode==1, throws a Gyoto::Error if errmode==0. + * \return pointer to the corresponding subcontractor. + */ + Gyoto::Spectrometer::Subcontractor_t* getSubcontractor(std::string name, + int errmode = 1); + + /** + * \brief A template for Subcontractor_t functions + * + * Instead of reimplementing the wheel, your subcontractor can + * simply be Gyoto::Spectrometer::Subcontractor. It must + * however implement setParameters(). + * + * \tparam T A Spectrometer::Generic sub-class. + */ + template SmartPointer Subcontractor + (FactoryMessenger* fmp) { + SmartPointer spectro = new T(); + if (fmp) spectro -> setParameters(fmp); + return spectro; + } + + /** + * \brief The Spectrometer register + * + * Use the Spectrometer::initRegister() once in your program to + * initiliaze it, the Spectrometer::Register() function to fill it, and + * the Spectrometer::getSubcontractor() function to query it. + */ + extern Gyoto::Register::Entry * Register_; + + /** + * \brief Initialize the Spectrometer register + * This must be called once. It initializes Register_ and + * registers the standard kinds (Uniform and Complex). + */ + void initRegister(); + + /** + * \brief Register a new Spectrometer kind + * + * Register a new Spectrometer::Generic sub-class so that the + * Gyoto::Factory knows it. + * + * \param name The kind name which identifies this object type in + * an XML file, as in <Spectrometer kind="name">. For + * clarity, this should be the same as the value of kind_ for this + * object, but it is not mandatory. + * + * \param scp A pointer to the subcontractor, which will + * communicate whith the Gyoto::Factory to build an instance of + * the class from its XML description. If all parameters can be + * set using setParameter(), this can be: + * \code + * &(Gyoto::Spectrometer::Subcontractor) + * \endcode + */ + void Register(std::string name, Gyoto::Spectrometer::Subcontractor_t* scp); +#endif + + } } -class Gyoto::Spectrometer : protected Gyoto::SmartPointee { - friend class Gyoto::SmartPointer; +class Gyoto::Spectrometer::Generic +: protected Gyoto::SmartPointee, + public Gyoto::Hook::Teller +{ + friend class Gyoto::SmartPointer; protected: - SpectroKind_t kind_; ///< none, freqlog, freq, wavelog or wave. - size_t nsamples_; ///< number of spectral elements - double band_[2]; ///< boundaries of the spectro + /** + * \brief Spectrometer kind name + * + * The content is not copied. kind_ should be set (as a parameter to + * the Generic() constructor or using setKind()) to the adress of a + * static variable holding the name. This allows checking the kind + * using pointer comparison rather than string comparison. + */ + kind_t kind_; + public: + size_t nsamples_; ///< Number of spectral elements + size_t nboundaries_; ///< Size of the boundaries_ array + + /** + * \brief Frequency (in Hz) at the boundaries of the spectral channels + * + * Array of size nboundaries_ + * + * Spectral channel i extends from + * \code + * boundaries_[chanind_[2*i]] + * \endcode + * to + * \code + * boundaries_[chanind_[2*i+1]] + * \endcode. + * Channels may or may not be contiguous or ordered. + */ double* boundaries_; + + /** + * \brief Indices in boundaries_ + * + * Array of size 2*nsamples_ + */ + size_t* chanind_; + + /** + * \brief Effective frequency (in Hz) of each spectral channel + * + * Array of size nsamples_ + */ double* midpoints_; - double* widths_; - void reset_(); ///< Computes boundaries_, midpoints_ and widths_ + /** + * \brief Width of each channel + * + * Array of size nsamples_ (in Hz) + */ + double* widths_; public: - Spectrometer() ; ///< Default constructor - Spectrometer(size_t nsamples, double band_min, double band_max, - SpectroKind_t kind); ///< Constructor setting everything - Spectrometer(const Spectrometer& ) ; ///< Copy constructor - Spectrometer * clone() const; ///< Cloner - virtual ~Spectrometer() ; ///< Destructor - - void setKind(SpectroKind_t); - void setKind(std::string); - void setNSamples(size_t n); - void setBand(double nu[2]); - - SpectroKind_t getKind() const ; - std::string getKindStr() const; - size_t getNSamples() const ; - double const * getBand() const ; - - double const * getMidpoints() const ; - double const * getChannels() const ; - double const * getWidths() const ; - + /** + * \brief Default constructor + * + * Sets each member to 0. + */ + Generic(); + + /** + * \brief Constructor setting kind + * + * Sets the other members to 0. This is usually the right + * constructor to use: + * \code + * Complex::Complex : Generic(Complex::Kind) {} + * \endcode + * + * Always set kind to the adress of a static variable, not to a temporary. + * Usually your class should have a static member for that purpose: + * \code + * class MyKind : public Spectrometer::Generic + * { + * static kind_t Kind; + * }; + * kind_t MyKind::Kind = "MyKind"; + * \endcode + * + */ + Generic(kind_t kind); + + /** + * \brief Copy constructor + * + * Takes care of (deep) copying all the members known to the base class. + */ + Generic(const Generic& ) ; + + /** + * \brief Clone an instance + * + * Use this to get a deep copy of an instance; + * \code + * SmartPointer myclone = orig->clone(); + * \endcode + * + * Most implementations will use the copy constructor: + * \code + * Generic* Uniform::clone() const { return new Uniform(*this); } + * \endcode + */ + virtual Generic * clone() const =0; + + /** + * \brief Destructor + * + * Takes care of deleting the arrays (if the pointers are not NULL). + */ + virtual ~Generic(); + + /** + * \brief Get kind_ + * + * You can check whether the Spectrometer sp is of a given kind + * MyKind with something like: + * + * \code + * if (sp->getKind()) == MyKind::Kind; + * \endcode + * + * See Uniform::WaveKind, Uniform::WaveLogKind, Uniform::FreqKind, + * Uniform::FreqLogKind and Complex::Kind. + * + */ + virtual kind_t getKind() const ; + + /** + * \brief Set Generic::kind_ + * + * This should rarely be used as the Generic::kind_ attribute usually is set + * in the constructor and doesn't change after that. + * + * Always set to the adress of a static variable, not to a temporary. + * Usually your class should have a static member for that purpose: + * \code + * class MyKind : public Spectrometer::Generic + * { + * static kind_t Kind; + * }; + * kind_t MyKind::Kind = "MyKind"; + * ... + * SmartPointer sp(); + * sp->setKind(MyKind::Kind) + * \endcode + * + */ + virtual void setKind(kind_t) ; + + virtual size_t getNSamples() const ; ///< Get Generic::nsamples_. + virtual size_t getNBoundaries() const ; ///< Get Generic::nboundaries_ + virtual double const * getMidpoints() const ; ///< Get Generic::midpoints_. + /** + * \brief Copy Generic::midpoints_, converting to unit + * \param data an array of Generic::nsamples_ doubles to fill with result + * \param unit a string + */ + virtual void getMidpoints( double data[], std::string unit); + /** + * \brief Copy Generic::boundaries_, converting to unit + * \param data an array of Generic::nboundaries_ doubles to fill with result + * \param unit a string + */ + virtual void getChannelBoundaries( double data[], std::string unit); + virtual double const * getChannelBoundaries() const ; ///< Get Generic::boundaries_. + virtual size_t const * getChannelIndices() const ; ///< Get Generic::chanind_. + virtual double const * getWidths() const ; ///< Get Generic::widths_. + /** + * \brief Copy Generic::widths_, converting to unit + * + * Think carefully before using: widths are often used to convert + * spectral flux density to flux. If flux density is per Herz, you + * don't need to convert widths. + * + * \param data an array of Generic::nboundaries_ doubles to fill with result + * \param unit a string + */ + virtual void getWidths( double data[], std::string unit); + + /** + * \brief Set parameter by name + * + * Assume MyKind is a subclass of Spectrometer::Generic which has + * two members (a string StringMember and a double DoubleMember): + * + * \code + * int MyKind::setParameter(std::string name, std::string content, std::string unit) + * { + * if (name=="StringMember") setStringMember(content); + * else if (name=="DoubleMember") setDoubleMemeber(atof(content.c_str()), unit); + * else return Generic::setParameter(name, content, unit); + * return 0; + * } + * \endcode + * + * If MyKind is not a direct subclass of Generic, it should call the + * corresponding setParameter() implementation instead of + * Generic::setParameter(). + * + * \param name XML name of the parameter + * \param content string representation of the value + * \param unit string representation of the unit + * \return 0 if this parameter is known, 1 if it is not. + */ + virtual int setParameter(std::string name, + std::string content, + std::string unit); #ifdef GYOTO_USE_XERCES - public: - void fillElement(FactoryMessenger *fmp); ///< called from Factory -#endif -}; + /** + * \brief Main loop in Subcontractor_t function + * + * The Subcontractor_t function for each Spectrometer kind should look + * somewhat like this (templated as + * Gyoto::Spectrometer::Subcontractor): + * + * \code + * SmartPointer + * Gyoto::Spectrometer::MyKind::Subcontractor(FactoryMessenger* fmp) + * { + * SmartPointer gg = new MyKind(); + * gg -> setParameters(fmp); + * return gg; + * } + * \endcode + * + * Each spectrometer kind should implement setParameter(string name, + * string content, string unit) to interpret the individual XML + * elements. setParameters() can be overloaded in case the specific + * Spectrometer class needs low level access to the FactoryMessenger. See + * Gyoto::Astrobj::UniformSphere::setParameters(). + */ + virtual void setParameters(Gyoto::FactoryMessenger *fmp) ; + + /** + * \brief Write out parameters to XML entities + * + * Spectrometers implementations should impement fillElement to save their + * parameters to XML and call the Spectrometer::fillElement(fmp) for the + * shared properties. + * + * This is mainly used by the Yorick plug-in to print out any sort + * of GYOTO objects and to save them to XML files. + */ + virtual void fillElement(FactoryMessenger *fmp) const ; -#ifdef GYOTO_USE_XERCES -namespace Gyoto { - SmartPointer SpectrometerSubcontractor(FactoryMessenger* fmp); -} #endif +}; #endif diff -Nru gyoto-0.0.3/include/GyotoSpectrum.h gyoto-0.1.0/include/GyotoSpectrum.h --- gyoto-0.0.3/include/GyotoSpectrum.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoSpectrum.h 2013-07-27 09:14:20.000000000 +0000 @@ -27,18 +27,87 @@ #ifndef __GyotoSpectrum_H_ #define __GyotoSpectrum_H_ -#include +#include "GyotoRegister.h" namespace Gyoto{ class FactoryMessenger; + /// Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star) namespace Spectrum { class Generic; +#if defined GYOTO_USE_XERCES + + /// A function to build instances of a specific Spectrum::Generic sub-class + /** + * This is a more specific version of the + * SmartPointee::Subcontractor_t type. A Spectrum::Subcontrator_t + * is called by the Gyoto::Factory to build an instance of the + * kind of spectrum specified in an XML file (see + * Register()). The Factory and Subcontractor_t function + * communicate through a Gyoto::FactoryMessenger. A template is + * provided so that you may not have to code anything. + */ typedef Gyoto::SmartPointer Subcontractor_t(Gyoto::FactoryMessenger* fmp); - void Register(std::string, Gyoto::Spectrum::Subcontractor_t*); - Gyoto::Spectrum::Subcontractor_t* getSubcontractor(std::string); + + /** + * \brief Subcontractor template + * + * Instead of reimplementing the wheel, your subcontractor can simply be + * Gyoto::Spectrum::Subcontractor + * + * \tparam T Sub-class of Spectrum::Generic + */ + template SmartPointer Subcontractor + (FactoryMessenger* fmp) { + SmartPointer sp = new T(); + sp -> setParameters(fmp); + return sp; + } + + /// Make a Spectrum kind known to the Factory + /** + * Register a new Spectrum::Generic sub-class so that the + * Gyoto::Factory knows it. + * + * \param kind The kind name which identifies this object type in + * an XML file, as in <Spectrum kind="name"> + * + * \param scp A pointer to the subcontractor, which will + * communicate whith the Gyoto::Factory to build an instance of + * the class from its XML description + */ + void Register(std::string kind, Gyoto::Spectrum::Subcontractor_t* scp); + + /// Query the Spectrum register + /** + * Query the Spectrum register to get the Metric::Subcontractor_t + * correspondig to a given kind name. This function is normally + * called only from the Factory. + * + * \param name e.g. "PowerLaw" + * \param errmode int=0. If errmode==0, failure to find a + * registered Spectrum by that name is an error. Else, simply + * return NULL pointer in that case. + * \return pointer to the corresponding subcontractor. + */ + Gyoto::Spectrum::Subcontractor_t* + getSubcontractor(std::string name, int errmode=0); + + /// The Spectrum register + /** + * Use the Spectrum::initRegister() once in your program to + * initiliaze it, the Spectrum::Register() function to fill it, and + * the Spectrum::getSubcontractor() function to query it. + */ extern Register::Entry* Register_; + + /// Empty the Spectrum register. + /** + * This must be called once. It is called by + * Gyoto::Register::init(). + */ void initRegister(); +#endif } } @@ -61,6 +130,8 @@ // Spectrum::Generic(const Spectrum::Generic &); ///< Copy constructor. Default is fine. virtual Generic * clone() const; ///< Cloner + virtual ~Generic() ; ///< Destructor: does nothing. + const std::string getKind() const; ///< Get spectrum kind virtual double operator()(double nu) const =0; @@ -69,13 +140,33 @@ * Generic implementation assumes emissivity = opacity. * * \param nu frequency in Hz - * \param opacity, such that opacity*ds=optical thickness. - * \param ds, in geometrical units + * \param opacity such that opacity*ds=optical thickness. + * \param ds in geometrical units */ virtual double operator()(double nu, double opacity, double ds) const; ///< I_nu in optically thin regime. + /** + * \brief Integrate optically thick I_nu + * + * See operator()(double nu) const + * + * \param nu1, nu2 boundaries for the integration + * \result I, the integral of I_nu between nu1 and nu2 + */ virtual double integrate(double nu1, double nu2) ; + + /** + * \brief Integrate optically thin I_nu + * + * See operator()(double nu, double opacity, double ds) const + * + * \param nu1, nu2 boundaries for the integration + * \param opacity the frequency-dependent opacity law given as a + * pointer to a Gyoto::Spectrum::Generic sub-class instance + * \param ds the element length for spatial integration + * \result I, the integral of I_nu between nu1 and nu2 + */ virtual double integrate(double nu1, double nu2, const Spectrum::Generic * opacity, double ds) ; @@ -88,9 +179,32 @@ virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory - virtual void setParameter(std::string name, std::string content) ; + virtual void setParameter(std::string name, + std::string content, + std::string unit) ; ///< To be called by fillElement() + /** + * The Subcontractor_t function for each Spectrum kind should look + * somewhat like this: + * \code + * SmartPointer + * Gyoto::Spectrum::MyKind::Subcontractor(FactoryMessenger* fmp) { + * SmartPointer sp = new MyKind(); + * sp -> setParameters(fmp); + * return sp; + * } + * \endcode + * + * Each spectrum kind should implement setParameter(string name, + * string content) to interpret the individual XML + * elements. setParameters() can be overloaded in case the specific + * Spectrum class needs low level access to the FactoryMessenger (see + * Astrobj::UniformSphere::setParameters()). + */ + virtual void setParameters(FactoryMessenger *fmp); + ///< Main loop in Subcontractor_t function + #endif }; diff -Nru gyoto-0.0.3/include/GyotoStandardAstrobj.h gyoto-0.1.0/include/GyotoStandardAstrobj.h --- gyoto-0.0.3/include/GyotoStandardAstrobj.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoStandardAstrobj.h 2013-07-27 09:14:20.000000000 +0000 @@ -91,8 +91,8 @@ // Data : // ----- protected: - double critical_value_; ///< see operator()(double const coord[4]) const - double safety_value_; ///< see operator()(double const coord[4]) const + double critical_value_; ///< See operator()(double const coord[4]) + double safety_value_; ///< See operator()(double const coord[4]) // Constructors - Destructor // ------------------------- @@ -122,8 +122,8 @@ // Accessors // --------- public: - virtual void setSafetyValue(double val) ; - virtual double getSafetyValue() const ; + virtual void setSafetyValue(double val) ; ///< Set Standard::safety_value_ + virtual double getSafetyValue() const ; ///< Get Standard::safety_value_ // Outputs // ------- @@ -132,37 +132,41 @@ Astrobj::Properties *data=NULL) ; /** + * \brief Function defining the object interior + * * A potential, distance, or whatever function such that - * operator()(double coord[4]) < critical_value_ if and only if - * coord is inside the object. This function is used by the default - * implmenetation of Impact(). If Impact() is overloaded, it is not - * necessary to overload operator()(double coord[4]). The default - * implementation throws an error. + * operator()(double const coord[4]) < Standard::critical_value_ if + * and only if coord is inside the object. This function is used by + * the default implmenetation of Impact(). If Impact() is + * overloaded, it is not necessary to overload operator()(double + * coord[4]). The default implementation throws an error. */ virtual double operator()(double const coord[4]) = 0; /** - * Used by Standard::Impact(). + * \brief Fluid velocity field. * * Fill vel with the 4-vector velocity of the fluid at 4-position pos. * - * \param pos input, 4-position at which to compute velocity; - * \param vel output, 4-velocity at pos. + * \param[in] pos 4-position at which to compute velocity; + * \param[out] vel 4-velocity at pos. */ virtual void getVelocity(double const pos[4], double vel[4]) = 0 ; /** - * Used by Standard::Impact(). + * \brief Maximum δ inside object * - * Gives the requested integration step delta_t (in coordinate time t) - * between two neighbooring - * points along a portion of geodesic inside an astrobj + * Gives the requested integration step δt (in + * coordinate time t) between two neighbooring points along a + * portion of geodesic inside an astrobj * - * \param coord input coordinate at which delta_t is given + * \param coord input coordinate at which δt is given */ virtual double giveDelta(double coord[8]); - virtual int setParameter(std::string name, std::string content) ; + virtual int setParameter(std::string name, + std::string content, + std::string unit = "") ; #ifdef GYOTO_USE_XERCES diff -Nru gyoto-0.0.3/include/GyotoStar.h gyoto-0.1.0/include/GyotoStar.h --- gyoto-0.0.3/include/GyotoStar.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoStar.h 2013-07-27 09:14:20.000000000 +0000 @@ -8,7 +8,7 @@ */ /* - Copyright 2011 Frederic Vincent, Thibaut Paumard + Copyright 2011, 2013 Frederic Vincent, Thibaut Paumard This file is part of Gyoto. @@ -37,6 +37,7 @@ #include #include #include +#include #ifdef GYOTO_USE_XERCES #include @@ -51,24 +52,27 @@ * Gyoto can compute the Star's orbit in a Gyoto::Metric and perform * ray-tracing on this target. The XML description of a Star looks * like: -\code - - - 0. - - 2. - 0. 0. 0.037037 - 600. 9. 1.5707999999999999741 0 - - 6000 - - - 0 - 0.1 - - - -\endcode + * \code + * + * + * 0. + * + * 2. + * 0. 0. 0.037037 + * 600. 9. 1.5707999999999999741 0 + * + * 6000 + * + * + * 0 + * 0.1 + * + * + * + * \endcode + * + * Star supports exactly the union of the parameters supported by + * Gyoto::Astrobj::UniformSphere and Gyoto::Worldline. * * The Metric element can be of any kind. This Metric sets the * coordinate system. @@ -93,19 +97,16 @@ // Data : // ----- - private: - int wait_pos_; ///< Hack in setParameters() - double * init_vel_; ///< Hack in setParameters() // Constructors - Destructor // ------------------------- public: /** * Create Star object and set initial condition. - * \param gg: Gyoto::SmartPointer to the Gyoto::Metric in this part of the Universe + * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this part of the Universe * \param radius star radius - * \param pos[4] initial position - * \param v[3] initial velocity + * \param pos initial 4-position + * \param v initial 3-velocity */ Star(SmartPointer gg, double radius, double pos[4], double v[3]) ; ///< Standard constructor @@ -140,18 +141,16 @@ virtual double getMass() const ; ///< Return 1. public: + using UniformSphere::getRmax; virtual double getRmax(); virtual void unsetRmax(); // void setCoordSys(int); ///< Get coordinate system for integration // int getCoordSys(); ///< Set coordinate system for integration void setInitialCondition(double coord[8]); ///< Same as Worldline::setInitialCondition(gg, coord, sys,1) - using Worldline::setInitCoord; - virtual void setInitCoord(double pos[4], double vel[3], int dir=1); - virtual void setPosition(double pos[4]); - virtual void setVelocity(double vel[3]); - - virtual int setParameter(std::string name, std::string content); + virtual int setParameter(std::string name, + std::string content, + std::string unit); public: #ifdef GYOTO_USE_XERCES @@ -165,6 +164,14 @@ #endif public: + + /// Get the 6 Cartesian coordinates for specific dates. + /** + * This method is present in both the API of UniformSphere and + * Worldline. It is pure virtual in UniformSphere. The Star + * reimplementation is a trivial wrapper around + * Worldline::getCartesian(). + */ virtual void getCartesian(double const * const dates, size_t const n_dates, double * const x, double * const y, double * const z, double * const xprime=NULL, diff -Nru gyoto-0.0.3/include/GyotoThinDisk.h gyoto-0.1.0/include/GyotoThinDisk.h --- gyoto-0.0.3/include/GyotoThinDisk.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoThinDisk.h 2013-07-27 09:14:20.000000000 +0000 @@ -74,8 +74,8 @@ // Data : // ----- protected: - double rin_ ; ///< disk inner radius - double rout_ ; ///< disk outer radius + double rin_ ; ///< disk inner radius in geometrical units + double rout_ ; ///< disk outer radius in geometrical units /** * Geometrical thickness in geometrical units. Used only in the @@ -104,11 +104,17 @@ // --------- public: virtual double getInnerRadius() const ; ///< Get rin_ + virtual double getInnerRadius(std::string unit) const ; ///< Get rin_ virtual void setInnerRadius(double); ///< Set rin_ + virtual void setInnerRadius(double, std::string unit); ///< Set rin_ virtual double getOuterRadius() const ; ///< Get rout_ + virtual double getOuterRadius(std::string unit) const ; ///< Get rout_ virtual void setOuterRadius(double); ///< Set rout_ + virtual void setOuterRadius(double, std::string unit); ///< Set rout_ virtual double getThickness() const ; ///< Get thickness_ + virtual double getThickness(std::string unit) const ; ///< Get thickness_ virtual void setThickness(double); ///< Set thickness_ + virtual void setThickness(double, std::string unit); ///< Set thickness_ virtual int getDir() const ; ///< Get dir_ virtual void setDir(int); ///< Set dir_ @@ -118,26 +124,27 @@ virtual double operator()(double const coord[]) ; ///< theta-pi/2 or z virtual double projectedRadius(double const coord[]) const ; - ///< projected radius of position coord on the equatorial plane + ///< Projected radius of position coord on the equatorial plane virtual double sphericalPhi(double const coord[]) const; - ///< longitude + ///< Longitude + /// Get fluid 4-velocity at point. /** - * Used by Standard::Impact(). - * * Fill vel with the 4-vector velocity of the fluid at 4-position * pos. getVelocity() should work at some distance from the * equatorial plane. The default implementation calls * Metric::Generic::circularVelocity(). * - * \param pos input, 4-position at which to compute velocity; - * \param vel output, 4-velocity at pos. + * \param[in] pos 4-position at which to compute velocity; + * \param[out] vel 4-velocity at pos. */ virtual void getVelocity(double const pos[4], double vel[4]) ; public: - virtual int setParameter(std::string name, std::string content) ; + virtual int setParameter(std::string name, + std::string content, + std::string unit) ; #ifdef GYOTO_USE_XERCES /** diff -Nru gyoto-0.0.3/include/GyotoThinDiskPL.h gyoto-0.1.0/include/GyotoThinDiskPL.h --- gyoto-0.0.3/include/GyotoThinDiskPL.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoThinDiskPL.h 2013-07-27 09:14:20.000000000 +0000 @@ -41,26 +41,23 @@ /** * \class Gyoto::Astrobj::ThinDiskPL - * \brief Geometrically thin disk in Kerr metric + * \brief Geometrically thin disk with black-body emission * - * This class describes a disk contained in the z=0 (equatorial) - * plane, extending from r=r_ISCO to r=infinity. The flux emitted - * at radius r is given by Page & Thorne (1974, ApJ 191:499, - * Eqs. 11b, 14, 15). + * Mass density varies with a power-law, temperature depends on density. * - * The metric must be either KerrBL or KerrKS. - * - * Warning: The spin value and the inner radius are cached when the - * metric is assigned using setMetric(). If the spin is later - * changed in the metric, updateSpin() must be called. + * ρ = ρ0 (rcur/r0)α * + * XML entities: + * - PLSlope: ThinDiskPL::PLSlope_ + * - PLRho: ThinDiskPL::PLRho_ + * - PLRadRef: ThinDiskPL::PLRadRef_ */ class Gyoto::Astrobj::ThinDiskPL : public Astrobj::ThinDisk { friend class Gyoto::SmartPointer; private: - double PLSlope_; - double PLRho_; - double PLRadRef_; + double PLSlope_; ///< Power law index + double PLRho_; ///< Reference density + double PLRadRef_; ///< Reference radius protected: SmartPointer spectrumBB_; ///< disk black body @@ -78,14 +75,18 @@ // Accessors // --------- public: + using ThinDisk::emission; virtual double emission(double nu_em, double dsem, double c_ph[8],double c_obj[8]) const; - double emissionBB(double nu, - double co[8]) const; + private: + /** + * \brief emission() helper + */ + double emissionBB(double nu, double co[8]) const; - int setParameter(std::string name, std::string content); public: + int setParameter(std::string name, std::string content, std::string unit); #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; ///< called from Factory #endif diff -Nru gyoto-0.0.3/include/GyotoTorus.h gyoto-0.1.0/include/GyotoTorus.h --- gyoto-0.0.3/include/GyotoTorus.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoTorus.h 2013-07-27 09:14:20.000000000 +0000 @@ -60,8 +60,8 @@ */ double c_; ///< Large Radius - SmartPointer spectrum_; - SmartPointer opacity_; + SmartPointer spectrum_; ///< Emission law + SmartPointer opacity_; ///< Absorption law // Constructors - Destructor // ------------------------- @@ -80,31 +80,76 @@ // --------- public: /** - * Get large radius c_ + * Get large radius Torus::c_ in geometrical units */ double getLargeRadius() const; /** - * Get small radius a_ + * Get large radius Torus::c_ in specified unit + */ + double getLargeRadius(std::string unit) const; + + /** + * Get small radius in geometrical units */ double getSmallRadius() const; + /** + * Get small radius in specified unit + */ + double getSmallRadius(std::string unit) const; + + /** + * \brief Set large radius Torus::c_ + */ void setLargeRadius(double c); + + /** + * \brief Set small radius + */ void setSmallRadius(double a); + + /** + * \brief Set large radius Torus::c_ in specified unit + */ + void setLargeRadius(double c, std::string unit); + + /** + * \brief Set small radius in specified unit + */ + void setSmallRadius(double a, std::string unit); + + /** + * \brief Set Torus::spectrum_ + */ virtual void setSpectrum(SmartPointer); + + /** + * \brief Get Torus::spectrum_ + */ virtual SmartPointer getSpectrum() const; + + /** + * \brief Set Torus::opacity_ + */ virtual void setOpacity(SmartPointer); + + /** + * \brief Get Torus::opacity_ + */ virtual SmartPointer getOpacity() const; + using Standard::getRmax; virtual double getRmax(); //XML I/O public: - virtual int setParameter(std::string name, std::string content) ; + virtual int setParameter(std::string name, + std::string content, + std::string unit) ; #ifdef GYOTO_USE_XERCES virtual void fillElement(FactoryMessenger *fmp) const ; - ///< called from Factory virtual void setParameters(FactoryMessenger *fmp) ; #endif @@ -116,18 +161,14 @@ protected: virtual void getVelocity(double const pos[4], double vel[4]) ; + using Standard::emission; virtual double emission(double nu_em, double dsem, double coord_ph[8], double coord_obj[8]=NULL) const ; - + using Standard::integrateEmission; virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const; - ///< \sum_nu1^nu2 I_nu dnu (or j_nu) virtual double transmission(double nuem, double dsem, double coord[8]) const ; - ///< Transmission: exp( \alpha_{\nu} * dsem ) - - // Display - //friend std::ostream& operator<<(std::ostream& , const Astrobj& ) ; }; diff -Nru gyoto-0.0.3/include/GyotoUniformSpectrometer.h gyoto-0.1.0/include/GyotoUniformSpectrometer.h --- gyoto-0.0.3/include/GyotoUniformSpectrometer.h 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/include/GyotoUniformSpectrometer.h 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,199 @@ +/** + * \file GyotoUniformSpectrometer.h + * \brief Uniformly spaced spectrometers + * + * Spectral channels are contiguous and uniformly spaced in either + * wavelength, frequency or log10 of + * either. Gyoto::Spectrometer::Uniform is registered four times in + * the factory: as kind="wave", "wavelog", "freq" and + * "freqlog". Example XML entity: + * \code + * + * 2.0 2.4 + * + * \endcode + * + * The content of the entity yields the band pass expressed in "unit" + * or in log10(unit). + * + */ +/* + Copyright 2011-2013 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#ifndef __GyotoUniformSpectrometer_H_ +#define __GyotoUniformSpectrometer_H_ + +#include + +namespace Gyoto{ + namespace Spectrometer { + class Uniform; + } +} + +/** + * \class Gyoto::Spectrometer::Uniform + * \brief Uniformly spaced spectrometers + * + * Spectral channels are contiguous and uniformly spaced in either + * wavelength, frequency or log10 of + * either. Gyoto::Spectrometer::Uniform is registered four times in + * the factory: as kind="wave", "wavelog", "freq" and + * "freqlog". Example XML entity: + * \code + * + * 2.0 2.4 + * + * \endcode + * + * The content of the entity yields the band pass expressed in "unit" + * or in log10(unit). + */ +class Gyoto::Spectrometer::Uniform : public Gyoto::Spectrometer::Generic { + friend class Gyoto::SmartPointer; + protected: + /** + * \brief boundaries of the spectro. + * + * Depending on the kind, band_ is stored in Hz, log10(Hz), m or log10(m). + */ + double band_[2]; + + void reset_(); ///< Computes boundaries_, midpoints_ and widths_ + + public: + Uniform() ; ///< Default constructor + Uniform(size_t nsamples, double band_min, double band_max, + kind_t kind); ///< Constructor setting everything + Uniform(const Uniform& ) ; ///< Copy constructor + Generic * clone() const; ///< Cloner + virtual ~Uniform() ; ///< Destructor + + void setKind(kind_t); + + /** + * \brief Set Generic::kind_ from a std::string + * + * Generic::kind_ will actually be set to one of Uniform::WaveKind, + * Uniform::WaveLogKind, Uniform::FreqKind or Uniform::FreqLogKind. + * + * \param name std::string, one of "wave", "wavelog", "freq" or + * "freqlog" + */ + void setKind(std::string name); + + /** + * \brief Set Generic::nsamples_ + */ + void setNSamples(size_t n); + + /** + * \brief Set Uniform::band_ + * + * \param nu 2-element vector, in Hz, m, log10(Hz) or log10(m) + * depending on Generic::kind_ + */ + void setBand(double nu[2]); + + /** + * \brief Set the spectral band boundaries in specified unit + * + * If kind is not specified, member kind_ is used. Else kind_ is updated. + * + * unit is actually the unit for 10^nu for freqlog and wavelog. Defaults: + * - kind==freq: nu in Hz + * - kind==freqlog: 10^nu in Hz + * - kind==wave: nu in meters + * - kind==wavelog: 10^nu in meters + * + */ + void setBand(double nu[2], std::string unit, std::string kind=""); + + double const * getBand() const ; ///< Get Uniform::band_ + +#ifdef GYOTO_USE_XERCES + public: + void fillElement(FactoryMessenger *fmp) const ; + + /** + * \brief Main loop in the (templated) subcontractor + * + * In the case of Spectrometer::Complex, the setParameter() API is + * not sufficient: setParameters() needs acces to the + * FactoryMessenger to instanciate childs for the SubSpectrometers. + */ + virtual void setParameters(FactoryMessenger *fmp); +#endif + + virtual int setParameter(std::string name, + std::string content, + std::string unit); + /** + * \brief "wave" + * + * Use this static member attribute to check whether a Spectrometer + * object spectro is of this kind: + * \code + * if (spectro->getKind() == Uniform::WaveKind) ... ; + * \endcode + * + */ + static kind_t const WaveKind; ///< "wave" + + /** + * \brief "wavelog" + * + * Use this static member attribute to check whether a Spectrometer + * object spectro is of this kind: + * \code + * if (spectro->getKind() == Uniform::WaveLogKind) ... ; + * \endcode + * + */ + static kind_t const WaveLogKind; + + /** + * \brief "freq" + * + * Use this static member attribute to check whether a Spectrometer + * object spectro is of this kind: + * \code + * if (spectro->getKind() == Uniform::FreqKind) ... ; + * \endcode + * + */ + static kind_t const FreqKind; + + /** + * \brief "freqlog" + * + * Use this static member attribute to check whether a Spectrometer + * object spectro is of this kind: + * \code + * if (spectro->getKind() == Uniform::FreqLogKind) ... ; + * \endcode + * + */ + static kind_t const FreqLogKind; + + +}; + + +#endif diff -Nru gyoto-0.0.3/include/GyotoUniformSphere.h gyoto-0.1.0/include/GyotoUniformSphere.h --- gyoto-0.0.3/include/GyotoUniformSphere.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoUniformSphere.h 2013-07-27 09:14:20.000000000 +0000 @@ -72,11 +72,11 @@ * Gyoto::Astrobj::UniformSphere::setParameters() take care of * interpreting the XML elements describing the parameters of the * sphere: -\code - value - parameters for this spectrum kind - parameters for this spectrum kind -\endcode + * \code + * value + * parameters for this spectrum kind + * parameters for this spectrum kind + * \endcode * setGenericParameters() also takes care of calling * setParameter(). */ @@ -87,7 +87,7 @@ // Data : // ----- protected: - double radius_ ; ///< sphere radius + double radius_ ; ///< sphere radius [geometrical units] SmartPointer spectrum_; ///< sphere emission law SmartPointer opacity_; ///< if optically thin, opacity law @@ -130,11 +130,15 @@ ///< Set opacity_ virtual SmartPointer getOpacity() const; ///< Get opacity_ - double getRadius() const ; ///< Get radius_ - void setRadius(double); ///< Set radius_ + double getRadius() const ; ///< Get radius_ in geometrical units + void setRadius(double); ///< Set radius_ in geometrical units + double getRadius(std::string) const ; ///< Get radius_ in specified unit + void setRadius(double, std::string); ///< Set radius_ in specified unit public: - virtual int setParameter(std::string name, std::string content) ; + virtual int setParameter(std::string name, + std::string content, + std::string unit) ; #ifdef GYOTO_USE_XERCES /** @@ -175,9 +179,11 @@ virtual void getVelocity(double const pos[4], double vel[4]) = 0; ///< Yield velocity of the center of the sphere. + using Standard::emission; virtual double emission(double nu_em, double dsem, double cp[8], double co[8]=NULL) const; ///< Emission is determined by spectrum_ and opacity_ + using Standard::integrateEmission; virtual double integrateEmission(double nu1, double nu2, double dsem, double c_ph[8], double c_obj[8]=NULL) const; virtual double transmission(double nuem, double dsem, double*) const ; diff -Nru gyoto-0.0.3/include/GyotoUtils.h gyoto-0.1.0/include/GyotoUtils.h --- gyoto-0.0.3/include/GyotoUtils.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoUtils.h 2013-07-27 09:14:20.000000000 +0000 @@ -27,18 +27,59 @@ #ifndef __GyotoUtils_H_ #define __GyotoUtils_H_ +#include "GyotoDefs.h" + #include -#include namespace Gyoto { - class Photon; - void debug(int mode); ///< mode=1 for debug output, 0 for no output - int debug(); ///< return >=1 if in debug mode, else 0 - void verbose(int mode); ///< mode=1 for debug output, 0 for no output - int verbose(); ///< return >=1 if in debug mode, else 0 + /// Set debug mode + /** + * \param mode 1 to turn on debug mode, 0 to turn it off. + */ + void debug(int mode); + + /// Get debug mode + /** + * \return >=1 if debug mode is on, else 0. + */ + int debug(); + + /// Set verbosity level + /** + * See standard verbosity levels defined in GyotoDefs.h: + * + * - GYOTO_DEFAULT_DEBUG_MODE + * - GYOTO_QUIET_VERBOSITY + * - GYOTO_SEVERE_VERBOSITY + * - GYOTO_WARNING_VERBOSITY + * - GYOTO_DEFAULT_VERBOSITY + * - GYOTO_INFO_VERBOSITY + * - GYOTO_DEBUG_VERBOSITY + */ + void verbose(int mode); + + /// Get verbosity level + /** + * See verbose(int mode). + */ + int verbose(); + + /// Convert lengths (deprecated) + /** + * \deprecated Will be removed once it is not used anymore in Gyoto + * per se. Prefer Gyoto::Units framework. + * + * \param[in,out] x Lengths to convert, in geometrical units on + * input, in specified unit on output. + * \param[in] nelem Size of x array. + * \param[in] mass_sun Black-hole mass in Solar masses. + * \param[in] distance_kpc Distance from observer in kiloparsecs. + * \param[in] unit One of "geometrical", "m", "km", "sun radius", + * "rad", "degree", "arcmin", "arcsec", "mas", "uas". + */ void convert(double * const x, const std::size_t nelem, const double mass_sun, const double distance_kpc, - const std::string unit); /// Convert lengths + const std::string unit); } #endif diff -Nru gyoto-0.0.3/include/GyotoWorldline.h gyoto-0.1.0/include/GyotoWorldline.h --- gyoto-0.0.3/include/GyotoWorldline.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoWorldline.h 2013-07-27 09:14:20.000000000 +0000 @@ -1,6 +1,6 @@ /** * \file GyotoWorldline.h - * \brief geodesics ? + * \brief Timelike or null geodesics */ /* @@ -32,19 +32,34 @@ namespace Gyoto { class Worldline; + class FactoryMessenger; } #include #include -#include #include +#include /** * \class Gyoto::Worldline - * \brief geodesic? + * \brief Timelike or null geodesics + * + * Supported XML parameters: + * - InitialCoordinate or InitCoord: 8-element vector yielding the initial + * 4-position and 4-velocity; + * - Only for massive particle (Gyoto::Astrobj::Star): Position + * (yielding initial 4-position) and Velocity (yielding initial + * 3-velocity); + * - Delta: integration step, initial in case or adaptive step; + * - Adaptive or NonAdaptive: sets whether integration step should be + * adaptive; default: Adaptive.; + * - MaxIter: maximum number of iterations for the integration; + * default: 100000. * */ -class Gyoto::Worldline { +class Gyoto::Worldline +: protected Gyoto::Hook::Listener +{ // Data : // ----- @@ -62,10 +77,14 @@ size_t imin_;///< Minimum index for which x0, x1... have been computed size_t i0_; ///< Index of initial condition in array size_t imax_;///< Maximum index for which x0, x1... have been computed + bool adaptive_; ///< Whether integration should use adaptive delta double delta_;///< Initial integrating step ; defaults to 0.01 - double tlim_;///< Minimum time for integration, stop integration if t); ///< Set metric Smartpointer SmartPointer getMetric() const; ///< Get metric - void setInitCoord(const double coord[8], int dir = 0); ///< Set Initial coordinate + virtual void setInitCoord(const double coord[8], int dir = 0); ///< Set Initial coordinate + + /** + * \brief Set initial coordinate + * + * \param pos initial 4-position + * \param vel initial 3-velocity + * \param dir direction of integration + */ + virtual void setInitCoord(double pos[4], double vel[3], int dir=1); + + virtual void setPosition(double pos[4]); ///< Set initial 4-position + virtual void setVelocity(double vel[3]); ///< Set initial 3-velocity + void reset() ; ///< Forget integration, keeping initial contition + void reInit() ; ///< Reset and recompute particle properties virtual std::string className() const ; ///< "Worldline" virtual std::string className_l() const ; ///< "worldline" @@ -128,63 +171,118 @@ /// Assignment to another Worldline void operator=(const Worldline&) ; void setDelta(const double delta); ///< Set delta - double getTlim() const ; ///< Get tlim value - void setTlim(double tlim); ///< Set tlim to a given value + void setDelta(double, const std::string &unit); ///< Set default step in specified units + double getDelta() const ; ///< Get delta + double getDelta(const std::string &unit) const ; ///< Get default step in specified units + double getTmin() const ; ///< Get tmin value + void setTmin(double tlim); ///< Set tmin to a given value + void adaptive (bool mode) ; ///< Set adaptive_ + bool adaptive () const ; ///< Get adaptive_ + void maxiter (size_t miter) ; ///< Set maxiter_ + size_t maxiter () const ; ///< Get maxiter_ /** * Return pointer to array holding the previously set * Metric-specific constants of motion */ double const * getCst() const ; ///< Returns the worldline's cst of motion (if any) + + /// Set Metric-specific constants of motion /** - * Set Metric-specific constants of motion + * The will (re)allocate Worldline::cst_, copy cst into it, and set + * Worldline::cst_n_. */ void setCst(double const * cst, size_t const ncsts) ; + /// Set or re-set the initial condition prior to integration. /** - * Set initial condition for this Photon : - * - * \param gg : Gyoto::SmartPointer to the Gyoto::Metric in this universe; - * - * \param coord : 8 element array containing the initial condition, + * \param gg Gyoto::SmartPointer to the Gyoto::Metric in this universe; + * \param coord 8 element array containing the initial condition, * i.e. the 4-position and the 4-velocity of the Photon at * the receiving end; - * - * \param sys : an integer stating in which coordinate system coord - * is given. + * \param dir direction: 1 for future, -1 for past. */ void setInitialCondition(SmartPointer gg, const double coord[8], const int dir) ; - /// screen, double *dalpha, double *ddellta, double *dD) const; + + /** + * \brief Get computed 4-velocities + */ void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const ; + + /** + * \brief Get computed 3-velocities + */ void get_prime(double *x1prime, double *x2prime, double *x3prime) const ; // Outputs @@ -238,7 +364,62 @@ /// Display friend std::ostream& operator<<(std::ostream& , const Worldline& ) ; + protected: + virtual void tell(Gyoto::Hook::Teller*); + class IntegState; +}; + + +/** + * \class Gyoto::Worldline::IntegState + * \brief Current state of a geodesic integration + */ + +class Gyoto::Worldline::IntegState : SmartPointee { + friend class Gyoto::SmartPointer; + + private: + /// Worldline that we are integrating. + /** + * Beware this is not a SmartPointer. Make sure line_ still exists + * when calling nestStep(). + */ + Worldline * line_; + + /// The Metric in this end of the Universe. + /** + * Taken from Worldline::line_, never updated. + */ + Gyoto::SmartPointer gg_; + + double coord_[8]; ///< Previously determined coordinate. + double norm_; ///< Current norm of the 4-velocity. + double normref_; ///< Initial norm of the 4-velocity. + double delta_; ///< Integration step (current in case of adaptive). + + /// Whether Worldline::delta_ is adaptive. + /** + * Taken from Worldline::line_, never updated. + */ + bool adaptive_; + + public: + /// Constructor + /** + * \param line The Worldline that we are integrating. Sets: + * Worldline::line_, Worldline::gg_, Worldline::adaptive_. + * \param coord Initial coordinate. + * \param delta Integration step. Sign determines direction. + */ + IntegState(Worldline * line, const double *coord, const double delta); + /// Make one step. + /** + * \param[out] coord Next position-velocity; + */ + virtual int nextStep(double *coord); + + virtual ~IntegState(); }; #endif diff -Nru gyoto-0.0.3/include/GyotoWorldlineIntegState.h gyoto-0.1.0/include/GyotoWorldlineIntegState.h --- gyoto-0.0.3/include/GyotoWorldlineIntegState.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/include/GyotoWorldlineIntegState.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/** - * \file GyotoWorldlineIntegState.h - * \brief Geodesic integration state - * - * - */ - -/* - Copyright 2011 Frederic Vincent, Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - -#ifndef __GyotoWorldlineIntegState_H_ -#define __GyotoWorldlineIntegState_H_ - -#include -#include - -namespace Gyoto { - class WorldlineIntegState; -} - -#include -#include -#include -#include -#include - -/** - * \class Gyoto::WorldlineIntegState - * \brief Current state of a geodesic integration - */ - -class Gyoto::WorldlineIntegState : SmartPointee { - friend class SmartPointer; - - private: - SmartPointer gg_; - - protected: - double coord_[8]; - double coordnew_[8]; - double norm_; - double normref_; - double delta_; - double h1_; - double deltainit_; - - public: - WorldlineIntegState(); - WorldlineIntegState(SmartPointer gg, const double *coord, const double delta); - - /** - * \param coord[8] on input: old position-velocity, on output: new - * position-velocity; - * \param delta integrating step in proper time. Set to 0 to use - * default step, presumably adaptive. - */ - virtual int nextStep(Gyoto::Worldline* line, double *coord, double delta=0.); - double get_delta(); - void set_delta(double delta); - void setCoord(double coord[8]); - virtual ~WorldlineIntegState(); -}; - -#endif diff -Nru gyoto-0.0.3/install-sh gyoto-0.1.0/install-sh --- gyoto-0.0.3/install-sh 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/install-sh 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru gyoto-0.0.3/lib/Astrobj.C gyoto-0.1.0/lib/Astrobj.C --- gyoto-0.0.3/lib/Astrobj.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Astrobj.C 2013-07-27 09:14:20.000000000 +0000 @@ -39,27 +39,34 @@ using namespace Gyoto; using namespace Gyoto::Astrobj; +#if defined GYOTO_USE_XERCES Register::Entry* Gyoto::Astrobj::Register_ = NULL; +#endif Generic::Generic(string kind) : gg_(NULL), rmax_(DBL_MAX), rmax_set_(0), kind_(kind), flag_radtransf_(0) { - if (debug()) cerr << "Astrobj Construction" << endl; - +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif } Generic::Generic() : gg_(NULL), rmax_(DBL_MAX), rmax_set_(0), kind_("Default"), flag_radtransf_(0) { - if (debug()) cerr << "Astrobj Construction" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif } Generic::Generic(double radmax) : gg_(NULL), rmax_(radmax), rmax_set_(1), kind_("Default"), flag_radtransf_(0) { - if (debug()) cerr << "Astrobj Construction" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif } Generic::Generic(const Generic& orig) : @@ -67,17 +74,24 @@ rmax_(orig.rmax_), rmax_set_(orig.rmax_set_), kind_(orig.kind_), flag_radtransf_(orig.flag_radtransf_) { - if (debug()) cerr << "DEBUG: in Astrobj::Generic (Copy)" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif if (orig.gg_()) { - if (debug()) - cerr << "DEBUG: orig had a metric, cloning" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "orig had a metric, cloning"<< endl; +#endif gg_=orig.gg_->clone(); } - if (debug()) cerr << "DEBUG: out of Astrobj::Generic (Copy)" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "done" << endl; +#endif } Generic::~Generic() { - if (debug()) cerr << "Astrobj Destruction" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif } SmartPointer Generic::getMetric() const { return gg_; } @@ -87,6 +101,10 @@ return rmax_; } +double Generic::getRmax(string unit) { + return Units::FromGeometrical(getRmax(), unit, gg_); +} + const string Generic::getKind() const { return kind_; } @@ -96,50 +114,29 @@ rmax_=val; } -void Generic::unsetRmax() { - rmax_set_=0; +void Generic::setRmax(double val, string unit) { + setRmax(Units::ToGeometrical(val, unit, gg_)); } -void Generic::checkPhiTheta(double coord[8]) const{ - switch (gg_ -> getCoordKind()) { - case GYOTO_COORDKIND_SPHERICAL: - { - /* Transforms theta and phi in coord so that - theta is in [0,pi] and phi in [0,2pi] */ - double thetatmp=coord[2], phitmp=coord[3]; - while (thetatmp>M_PI) thetatmp-=2.*M_PI; - while (thetatmp<-M_PI) thetatmp+=2.*M_PI;//then theta in [-pi,pi] - if (thetatmp<0.) { - thetatmp=-thetatmp;//then theta in [0,pi] - phitmp+=M_PI;//thus, same point x,y,z - } - while (phitmp>2.*M_PI) phitmp-=2.*M_PI; - while (phitmp<0.) phitmp+=2.*M_PI;//then phi in [0,2pi] - coord[2]=thetatmp; - coord[3]=phitmp; - } - break; - case GYOTO_COORDKIND_CARTESIAN: - throwError("Astrobj::checkPhiTheta(): should not be called " - "with cartesian-like coordinates"); - default: - throwError("Astrobj::checkPhiTheta(): unknown COORDKIND"); - } - +void Generic::unsetRmax() { + rmax_set_=0; } - #ifdef GYOTO_USE_XERCES void Generic::fillElement(FactoryMessenger *fmp) const { + if (rmax_set_) fmp -> setParameter ( "RMax", rmax_ ) ; fmp -> setMetric(gg_); fmp -> setSelfAttribute("kind", kind_); fmp -> setParameter ( flag_radtransf_? "OpticallyThin" : "OpticallyThick"); } void Generic::setParameters(FactoryMessenger *fmp) { - string name="", content=""; - setMetric(fmp->getMetric()); - while (fmp->getNextParameter(&name, &content)) setParameter(name, content); + string name="", content="", unit=""; + if (fmp) { + setMetric(fmp->getMetric()); + while (fmp->getNextParameter(&name, &content, &unit)) + setParameter(name, content, unit); + } } #endif @@ -147,22 +144,22 @@ void Generic::setFlag_radtransf(int flag) {flag_radtransf_=flag;} int Generic::getFlag_radtransf() const {return flag_radtransf_;} -int Generic::setParameter(string name, string content) { +int Generic::setParameter(string name, string content, string unit) { char* tc = const_cast(content.c_str()); if (name=="Flag_radtransf") flag_radtransf_= atoi(tc); else if (name=="OpticallyThin") flag_radtransf_= 1; else if (name=="OpticallyThick") flag_radtransf_= 0; - else if (name=="RMax") { - rmax_ = atof(tc); rmax_set_=1; - } else return 1; + else if (name=="RMax") setRmax(atof(tc), unit); + else return 1; return 0; } void Generic::processHitQuantities(Photon* ph, double* coord_ph_hit, double* coord_obj_hit, double dt, Properties* data) const { - if (debug()) - cerr << "DEBUG: in Generic::processHitQuantities:" << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif /* NB: freqObs is the observer's frequency chosen in Screen::getRayCoord for the actual computation of the geodesic ; @@ -171,47 +168,47 @@ (see below) ; this freqObs is used to transform the null worldline parameter dlambda (see below) */ - double freqObs=ph->getFreqObs(), nuem; - SmartPointer spr = ph -> getSpectrometer(); + double freqObs=ph->getFreqObs(); // this is a useless quantity, always 1 + SmartPointer spr = ph -> getSpectrometer(); size_t nbnuobs = spr() ? spr -> getNSamples() : 0 ; double const * const nuobs = nbnuobs ? spr -> getMidpoints() : NULL; double dlambda = dt/coord_ph_hit[4]; //dlambda = dt/tdot + // cout << "freqObs="<ScalarProd(coord_ph_hit,coord_obj_hit+4, - coord_ph_hit+4) / freqObs; + coord_ph_hit+4);// / 1.; //this is nu_em/nu_obs + // for nuobs=1. Hz double ggred = 1./ggredm1; //this is nu_obs/nu_em - double dsem = dlambda*freqObs*ggredm1; + double dsem = dlambda*ggredm1; // * 1Hz ? + double inc =0.; if (data) { - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities: data requested" << endl; - - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities: data requested, " - << "freqObs=" << freqObs << ", ggredm1=" << ggredm1 - << ", ggred=" << ggred - << endl; - +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "data requested. " + << "freqObs=" << freqObs << ", ggredm1=" << ggredm1 + << ", ggred=" << ggred + << endl; +#endif if (data->redshift) { *data->redshift=ggred; - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities(): " - << "redshift=" << *data->redshift << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(*data->redshift); +#endif } if (data->time) { *data->time=coord_ph_hit[0]; - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities(): " - << "time=" << *data->time << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(*data->time); +#endif } if (data->impactcoords) { memcpy(data->impactcoords, coord_obj_hit, 8 * sizeof(double)); memcpy(data->impactcoords+8, coord_ph_hit, 8 * sizeof(double)); } - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities: " - << "dlambda = (dt="<< dt << ")/(tdot="<< coord_ph_hit[4] - << ") = " << dlambda << ", dsem=" << dsem << endl; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "dlambda = (dt="<< dt << ")/(tdot="<< coord_ph_hit[4] + << ") = " << dlambda << ", dsem=" << dsem << endl; +#endif if (data->intensity) { /* Comment on intensity integration: @@ -240,59 +237,90 @@ I_nu_obs = I_nu_em*(nu_obs/nu_em)^3 */ - //I_nu_obs increment : - *data->intensity += - (emission(freqObs*ggredm1, dsem, coord_ph_hit, coord_obj_hit)) - * (ph -> getTransmission(size_t(-1))) - * ggred*ggred*ggred; - - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities(): " - << "intensity +=" << *data->intensity - << "= emission((dsem=" << dsem << "))=" - << (emission(freqObs*ggredm1,dsem,coord_ph_hit, coord_obj_hit)) - << ")*(ggred=" << ggred << ")^3*(transmission=" - << (ph -> getTransmission(size_t(-1))) << ")" - << endl; + //Intensity increment : + GYOTO_DEBUG_EXPR(freqObs); + GYOTO_DEBUG_EXPR(freqObs*ggredm1); + inc = (emission(freqObs*ggredm1, dsem, coord_ph_hit, coord_obj_hit)) + * (ph -> getTransmission(size_t(-1))) + * ggred*ggred*ggred; // I_nu/nu^3 invariant +# ifdef HAVE_UDUNITS + if (data -> intensity_converter_) + inc = (*data -> intensity_converter_)(inc); +# endif + *data->intensity += inc; + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG + << "intensity +=" << *data->intensity + << "= emission((dsem=" << dsem << "))=" + << (emission(freqObs*ggredm1,dsem,coord_ph_hit, coord_obj_hit)) + << ")*(ggred=" << ggred << ")^3*(transmission=" + << (ph -> getTransmission(size_t(-1))) << ")" + << endl; +# endif + } if (data->binspectrum) { - double const * const channels = spr -> getChannels(); - double nuem1, nuem2; + size_t nbounds = spr-> getNBoundaries(); + double const * const channels = spr -> getChannelBoundaries(); + size_t const * const chaninds = spr -> getChannelIndices(); + double * I = new double[nbnuobs]; + double * boundaries = new double[nbounds]; + for (size_t ii=0; iibinspectrum[ii*data->offset] += - integrateEmission(nuem1, nuem2, dsem, - coord_ph_hit, coord_obj_hit) - * ph -> getTransmission(ii) - *ggred*ggred*ggred*ggred; - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities(): " + inc = I[ii] * ph -> getTransmission(ii) * ggred*ggred*ggred*ggred; +# ifdef HAVE_UDUNITS + if (data -> binspectrum_converter_) + inc = (*data -> binspectrum_converter_)(inc); +# endif + data->binspectrum[ii*data->offset] += inc ; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "nuobs[" << ii << "]="<< channels[ii] - << ", nuem=" << nuem1 + << ", nuem=" << boundaries[ii] << ", binspectrum[" << ii+data->offset << "]=" << data->binspectrum[ii*data->offset]<< endl; +# endif } + delete [] I; + delete [] boundaries; } if (data->spectrum) { + double * Inu = new double[nbnuobs]; + double * nuem = new double[nbnuobs]; + for (size_t ii=0; iispectrum[ii*data->offset] += - emission(nuem, dsem, coord_ph_hit, coord_obj_hit) - * ph -> getTransmission(ii) - *ggred*ggred*ggred; - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities(): " + inc = Inu[ii] * ph -> getTransmission(ii) * ggred*ggred*ggred; +# ifdef HAVE_UDUNITS + if (data -> spectrum_converter_) + inc = (*data -> spectrum_converter_)(inc); +# endif + data->spectrum[ii*data->offset] += inc; + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG + << "DEBUG: Generic::processHitQuantities(): " << "nuobs[" << ii << "]="<< nuobs[ii] << ", nuem=" << nuem << ", dsem=" << dsem << ", Inu * GM/c2=" - << emission(nuem, dsem, coord_ph_hit, coord_obj_hit) + << Inu[ii] << ", spectrum[" << ii*data->offset << "]=" << data->spectrum[ii*data->offset] << ", transmission=" << ph -> getTransmission(ii) << ", redshift=" << ggred << ")\n"; +# endif } + delete [] Inu; + delete [] nuem; } /* update photon's transmission */ ph -> transmit(size_t(-1), @@ -300,27 +328,47 @@ for (size_t ii=0; ii transmit(ii,transmission(nuobs[ii]*ggredm1,dsem,coord_ph_hit)); } else { - if (debug()) - cerr << "DEBUG: Generic::processHitQuantities: NO data requested!\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "NO data requested!" << endl; +# endif } } double Generic::transmission(double, double, double*) const { - if (debug()) - cerr << "DEBUG: Generic::transmission(): flag_radtransf_=" - << flag_radtransf_ << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(flag_radtransf_); +# endif return double(flag_radtransf_); } double Generic::emission(double , double dsem, double *, double *) const { - if (debug()) - cerr << "DEBUG: Generic::emission(): flag_radtransf_=" - << flag_radtransf_ << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(flag_radtransf_); +# endif if (flag_radtransf_) return dsem; return 1.; } +void Generic::emission(double * Inu, double * nuem , size_t nbnu, + double dsem, double *cph, double *co) const +{ +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(flag_radtransf_); +# endif + for (size_t i=0; i< nbnu; ++i) Inu[i]=emission(nuem[i], dsem, cph, co); +} + +void Generic::integrateEmission(double * I, double const * boundaries, + size_t const * chaninds, size_t nbnu, + double dsem, double *cph, double *co) const +{ + for (size_t i=0; i getSubcontractor(name); + -> getSubcontractor(name, errmode); } +#endif Astrobj::Properties::Properties() : @@ -383,6 +433,10 @@ redshift(NULL), spectrum(NULL), binspectrum(NULL), offset(1), impactcoords(NULL), user1(NULL), user2(NULL), user3(NULL), user4(NULL), user5(NULL) +# ifdef HAVE_UDUNITS + , intensity_converter_(NULL), spectrum_converter_(NULL), + binspectrum_converter_(NULL) +# endif {} Astrobj::Properties::Properties( double * I, double * t) : @@ -391,6 +445,10 @@ redshift(NULL), spectrum(NULL), binspectrum(NULL), offset(1), impactcoords(NULL), user1(NULL), user2(NULL), user3(NULL), user4(NULL), user5(NULL) +# ifdef HAVE_UDUNITS + , intensity_converter_(NULL), spectrum_converter_(NULL), + binspectrum_converter_(NULL) +# endif {} void Astrobj::Properties::init(size_t nbnuobs) { @@ -410,6 +468,38 @@ if (user5) *user5=0.; } +#ifdef HAVE_UDUNITS +void Astrobj::Properties::setIntensityConverter(SmartPointer conv) { + intensity_converter_ = conv ; +} + +void Astrobj::Properties::setIntensityConverter(string unit) { + intensity_converter_ = + new Units::Converter("J.m-2.s-1.sr-1.Hz-1", + unit!=""?unit:"J.m-2.s-1.sr-1.Hz-1"); +} + +void Astrobj::Properties::setSpectrumConverter(SmartPointer conv) { + spectrum_converter_ = conv; +} + +void Astrobj::Properties::setSpectrumConverter(string unit) { + spectrum_converter_ = + new Units::Converter("J.m-2.s-1.sr-1.Hz-1", + unit!=""?unit:"J.m-2.s-1.sr-1.Hz-1"); +} + +void Astrobj::Properties::setBinSpectrumConverter(SmartPointer conv) { + binspectrum_converter_ = conv; +} +void Astrobj::Properties::setBinSpectrumConverter(string unit) { + binspectrum_converter_ = + new Units::Converter("J.m-2.s-1.sr-1", + unit!=""?unit:"J.m-2.s-1.sr-1"); +} + +#endif + Astrobj::Properties Astrobj::Properties::operator++() { if (intensity) ++intensity; if (time) ++time; diff -Nru gyoto-0.0.3/lib/BlackBodySpectrum.C gyoto-0.1.0/lib/BlackBodySpectrum.C --- gyoto-0.0.3/lib/BlackBodySpectrum.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/BlackBodySpectrum.C 2013-07-27 09:14:20.000000000 +0000 @@ -44,6 +44,15 @@ /(exp(GYOTO_PLANCK_OVER_BOLTZMANN*nu*Tm1_)-1.); } +void Spectrum::BlackBody::setParameter(std::string name, + std::string content, + std::string unit) { + char * tc=const_cast(content.c_str()); + if (name=="Temperature") setTemperature(atof(tc)); + else if (name=="Scaling") setScaling(atof(tc)); + else Spectrum::Generic::setParameter(name, content, unit); +} + #ifdef GYOTO_USE_XERCES void Spectrum::BlackBody::fillElement(FactoryMessenger *fmp) const { fmp->setParameter("Temperature", T_); @@ -51,23 +60,4 @@ Spectrum::Generic::fillElement(fmp); } -SmartPointer -Gyoto::Spectrum::BlackBodySubcontractor(FactoryMessenger* fmp) { - SmartPointer sp = new Spectrum::BlackBody(); - if (!fmp) return sp; - std::string name="", content=""; char *tc; - while (fmp->getNextParameter(&name, &content)) { - tc=const_cast(content.c_str()); - if (name=="Temperature") sp->setTemperature(atof(tc)); - else if (name=="Scaling") sp->setScaling(atof(tc)); - else sp -> setParameter(name, content); - } - return sp; -} - -void Gyoto::Spectrum::BlackBodyInit() { - Gyoto::Spectrum::Register("BlackBody", - &Gyoto::Spectrum::BlackBodySubcontractor); -} #endif - diff -Nru gyoto-0.0.3/lib/ComplexAstrobj.C gyoto-0.1.0/lib/ComplexAstrobj.C --- gyoto-0.0.3/lib/ComplexAstrobj.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/ComplexAstrobj.C 2013-07-27 09:14:20.000000000 +0000 @@ -178,12 +178,12 @@ if (debug()) cerr << "DEBUG: in Complex::setParameters()" << endl; - string name="", content=""; + string name="", content="", unit=""; FactoryMessenger * child = NULL; setMetric( fmp->getMetric() ); - while (fmp->getNextParameter(&name, &content)) { + while (fmp->getNextParameter(&name, &content, &unit)) { if (debug()) cerr << "DEBUG: Astrobj::Complex::Subcontractor(): name=" << name << endl; if (name=="SubAstrobj") { @@ -191,7 +191,7 @@ child = fmp -> getChild(); append ((*Astrobj::getSubcontractor(content))(child)); delete child; - } else setParameter(name, content); + } else setParameter(name, content, unit); } if (debug()) diff -Nru gyoto-0.0.3/lib/ComplexSpectrometer.C gyoto-0.1.0/lib/ComplexSpectrometer.C --- gyoto-0.0.3/lib/ComplexSpectrometer.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/ComplexSpectrometer.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,185 @@ +/* + Copyright 2013 Thibaut Paumard, Frederic Vincent + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include "GyotoComplexSpectrometer.h" +#include "GyotoFactoryMessenger.h" +#include "GyotoMetric.h" +#include "GyotoPhoton.h" + +#include + +using namespace std; +using namespace Gyoto; +using namespace Gyoto::Spectrometer; + +kind_t const Complex::Kind = "Complex"; + +Complex::Complex() : + Generic(Complex::Kind), + cardinal_(0), + elements_(NULL) +{ + +} + +Complex::Complex(const Complex& o) : + Generic(o), + cardinal_(o.cardinal_), + elements_(NULL) +{ + if (cardinal_) { + elements_ = new SmartPointer [cardinal_]; + for (size_t i=0; i< cardinal_; ++i) { + elements_[i] = o[i]->clone(); + } + } +} +Complex *Complex::clone() const {return new Complex(*this); } + + +Complex::~Complex() +{ + if (cardinal_) for (size_t i=0; i< cardinal_; ++i) elements_[i] = NULL; +} + +void Complex::append(SmartPointer e) +{ + GYOTO_DEBUG << "DEBUG: in Complex::append(SmartPointer e)" << endl; + if (cardinal_+1 == 0) throwError("Complex::append(): OVERFLOW"); + SmartPointer * orig = elements_; + elements_ = new SmartPointer [cardinal_+1]; + for (size_t i=0; i< cardinal_; ++i) { + elements_[i] = orig[i]; + orig[i] = NULL; + } + delete [] orig; orig = NULL; + elements_[cardinal_] = e; + ++cardinal_; + e->hook(this); + GYOTO_DEBUG << "DEBUG: out Complex::append(SmartPointer e)" << endl; + tell(this); +} + +SmartPointer Complex::operator[](size_t i) +{ + if (i > cardinal_) + throwError("Complex::operator[](size_t i): no such element"); + return elements_[i]; +} + +SmartPointer const Complex::operator[](size_t i) const +{ + if (i > cardinal_) + throwError("Complex::operator[](size_t i): no such element"); + return elements_[i]; +} + +void Complex::remove(size_t i) { + if (i >= cardinal_) + throwError("Complex::remove(size_t i): no such element"); + elements_[i]->unhook(this); + SmartPointer * orig = elements_; + if (--cardinal_) elements_ = new SmartPointer [cardinal_]; + else elements_ = NULL; + size_t k, j=0; + for (k=0; k<= cardinal_; ++k) { + if (k != i) elements_[j++] = orig[k]; + orig[k] = NULL; + } + delete [] orig; + tell(this); // tell self! +} + +size_t Complex::getCardinal() const {return cardinal_; } + +#ifdef GYOTO_USE_XERCES +void Complex::fillElement(FactoryMessenger *fmp) const { + FactoryMessenger * childfmp=NULL; + + for (size_t i=0; i makeChild ( "SubSpectrometer" ); + elements_[i] -> fillElement(childfmp); + delete childfmp; + } + + Spectrometer::Generic::fillElement(fmp); +} + +void Complex::setParameters(FactoryMessenger *fmp) { + if (debug()) + cerr << "DEBUG: in Complex::setParameters()" << endl; + + string name="", content="", unit=""; + FactoryMessenger * child = NULL; + + while (fmp->getNextParameter(&name, &content, &unit)) { + if (debug()) + cerr << "DEBUG: Spectrometer::Complex::Subcontractor(): name=" << name << endl; + if (name=="SubSpectrometer") { + content = fmp -> getAttribute("kind"); + child = fmp -> getChild(); + append ((*Spectrometer::getSubcontractor(content))(child)); + delete child; + } else setParameter(name, content, unit); + } + + if (debug()) + cerr << "DEBUG: out Complex::setParameters()" << endl; +} +#endif + +void Complex::tell(Gyoto::Hook::Teller *) { + // This is called each time an element is added or mutated + // This is suboptimal, but most straightforward + nboundaries_=nsamples_=0; + for (size_t i=0; igetNSamples(); + nboundaries_ += elements_[i]->getNBoundaries(); + } + if (boundaries_) delete [] boundaries_; + if (widths_) delete [] widths_; + if (midpoints_) delete [] midpoints_; + if (chanind_) delete [] chanind_; + boundaries_ = new double [nboundaries_]; + widths_ = new double [nsamples_]; + midpoints_ = new double [nsamples_]; + chanind_ = new size_t [2*nsamples_]; + + size_t boffset=0, offset=0; + size_t const * chanind=0; + for (size_t i=0; igetNBoundaries(); + double ens = elements_[i]->getNSamples(); + memcpy(boundaries_+boffset, + elements_[i]->getChannelBoundaries(), + enb*sizeof(double)); + memcpy(widths_+offset, + elements_[i]->getWidths(), + ens*sizeof(double)); + memcpy(midpoints_+offset, + elements_[i]->getMidpoints(), + ens*sizeof(double)); + chanind=elements_[i]->getChannelIndices(); + for (size_t j=0; j<2*ens; ++j) + chanind_[2*offset+j]=chanind[j]+boffset; + boffset += enb; + offset += ens ; + } + tellListeners(); +} diff -Nru gyoto-0.0.3/lib/Converters.C gyoto-0.1.0/lib/Converters.C --- gyoto-0.0.3/lib/Converters.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/Converters.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,412 @@ +#include "GyotoConverters.h" +#include "GyotoError.h" +#include "GyotoMetric.h" + +using namespace Gyoto::Units ; +using namespace std ; + +#ifdef HAVE_UDUNITS +static ut_system * SI (NULL); +static Gyoto::SmartPointer Meter (NULL); +static Gyoto::SmartPointer Second (NULL); +static Gyoto::SmartPointer KiloGram (NULL); +#endif + +void Gyoto::Units::Init() { +#ifdef HAVE_UDUNITS + ut_set_error_message_handler(ut_ignore); + SI = ut_read_xml(NULL); + + ut_unit * tmpu = NULL, * tmpu2 = NULL; + + /* Map pc for parsec */ + tmpu = ut_get_unit_by_name(SI, "parsec"); + ut_map_symbol_to_unit("pc", UT_UTF8, tmpu); + ut_free(tmpu); tmpu = NULL; + + /* astronomical_unit aliases */ + tmpu = ut_get_unit_by_name(SI, "astronomical_unit"); + ut_map_symbol_to_unit("au", UT_UTF8, tmpu); + ut_map_symbol_to_unit("AU", UT_UTF8, tmpu); + ut_map_symbol_to_unit("ua", UT_UTF8, tmpu); + ut_map_symbol_to_unit("astronomicalunit", UT_UTF8, tmpu); + ut_free(tmpu); tmpu = NULL; + + /* as symbol for arcsec */ + tmpu = ut_get_unit_by_name(SI, "arcsec"); + if (!tmpu) throwError("error initializing arcsec unit"); + ut_map_symbol_to_unit("as", UT_UTF8, tmpu); + ut_free(tmpu); tmpu = NULL; + + /* sunradius */ + tmpu = ut_get_unit_by_name(SI, "meter"); + tmpu2 = ut_scale(GYOTO_SUN_RADIUS, tmpu); + ut_map_symbol_to_unit("sunradius", UT_UTF8, tmpu); + ut_free(tmpu2); + ut_free(tmpu); + + /* ly */ + tmpu = ut_get_unit_by_name(SI, "light_year"); + ut_map_symbol_to_unit("ly", UT_UTF8, tmpu); + ut_free(tmpu); + + /* sunmass */ + tmpu = ut_get_unit_by_symbol(SI, "kg"); + tmpu2 = ut_scale(GYOTO_SUN_MASS, tmpu); + ut_map_symbol_to_unit("sunmass", UT_UTF8, tmpu2); + ut_free(tmpu2); + ut_free(tmpu); + + /* Jansky */ + tmpu = ut_parse(SI, "W.m-2.Hz-1", UT_UTF8); + if (!tmpu) throwError("Cannot initialize Jansky"); + tmpu2=ut_scale(1e-26, tmpu); + ut_map_name_to_unit("Jansky", UT_UTF8, tmpu2); + ut_map_symbol_to_unit("Jy", UT_UTF8, tmpu2); + ut_free(tmpu2); + ut_free(tmpu); + + Meter = new Unit("meter"); + Second = new Unit("second"); + KiloGram = new Unit("kilogram"); +#endif +} + +#ifdef HAVE_UDUNITS +/* Unit class */ +Unit::Unit(const string &unit) : unit_(NULL), kind_(unit) { +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(kind_); +# endif + if (kind_!="") { + unit_ = ut_parse(SI, unit.c_str(), UT_UTF8); +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(unit_); +# endif + if (!unit_) throwError("Error initializing Unit"); + } +} + +Unit::Unit(char const * const unit) : unit_(NULL), kind_(unit) { +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(kind_); +# endif + if (kind_!="") { + unit_ = ut_parse(SI, unit, UT_UTF8); +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(unit_); +# endif + if (!unit_) throwError("Error initializing Unit"); + } +} + +Unit::~Unit() { + ut_free(unit_); +} + +double Unit::To(double val, const Unit &from_unit) { + return Converter(from_unit, *this)(val); +} + +double Unit::From(double val, const Unit &to_unit) { + return Converter(*this, to_unit)(val); +} + +Unit::operator std::string() const { return kind_; } +Unit::operator ut_unit*() const { return unit_; } + +/* Converter */ +Converter::Converter() : converter_(cv_get_trivial()) {} + +Converter::Converter(const Gyoto::Units::Unit &from, + const Gyoto::Units::Unit &to) : + converter_(NULL) +{ + reset(from, to); +} + +void Converter::reset() +{ + if (converter_) cv_free(converter_); + converter_ = cv_get_trivial(); +} + +void Converter::reset(const Gyoto::Units::Unit &from, + const Gyoto::Units::Unit &to) +{ + if (converter_) { cv_free(converter_); converter_=NULL; } + if ((ut_unit*)(from) && (ut_unit*)(to)) { + if (areConvertible(from, to)) converter_ = ut_get_converter(from, to); + else { + stringstream ss; + ss << "Unsupported conversion: from \"" << string(from) + << "\" to " << string(to) << "\""; + throwError(ss.str()); + } + } else reset(); +} + +Converter::~Converter() { + if (converter_) { cv_free(converter_); converter_ = NULL; } +} + +double Converter::operator()(double val) const { + return cv_convert_double(converter_, val); +} + +ut_system * Gyoto::Units::getSystem() { return SI; } + +#endif + +double Gyoto::Units::ToMeters(double val, const string &unit, + const SmartPointer &gg) { + if (unit=="" || unit=="m") return val ; + if (unit=="geometrical") { + if (gg) return val * gg -> unitLength(); + else throwError("Metric required for geometrical -> meter conversion"); + } +# ifdef HAVE_UDUNITS + Unit from(unit); + if (areConvertible(from, *Meter)) return Meter->To(val, from); + if (areConvertible(from, *Second)) return Second->To(val, from)*GYOTO_C; + return GYOTO_C/ToHerz(val, unit); +# else + if (unit=="cm") return val * 1e-2; + if (unit=="km") return val * 1e3; + if (unit=="sunradius") return val * GYOTO_SUN_RADIUS; + if ((unit=="astronomicalunit") || + (unit=="astronomical_unit") || + (unit=="AU") || + (unit=="au") || + (unit=="ua")) + return val * GYOTO_ASTRONOMICAL_UNIT; + if (unit=="ly") return val * GYOTO_LIGHT_YEAR; + if (unit=="pc") return val * GYOTO_KPC * 1e-3; + if (unit=="kpc") return val * GYOTO_KPC; + if (unit=="Mpc") return val * GYOTO_KPC * 1e3; + stringstream ss; + ss << "Unsupported conversion: \"" << unit; + throwError(ss.str()); + return 0; +# endif +} + +double Gyoto::Units::FromMeters(double val, const string &unit, + const SmartPointer &gg) { + if ((unit=="") || (unit=="m")) return val ; + if (unit=="geometrical") { + if (gg) return val / gg -> unitLength(); + else throwError("Metric required for meter -> geometrical conversion"); + } +# ifdef HAVE_UDUNITS + Unit to (unit); + if (areConvertible(to, *Meter)) return Meter->From(val, to); + if (areConvertible(to, *Second)) return Second->From(val*GYOTO_C, to); + return FromHerz(GYOTO_C/val, unit); +# else + if (unit=="cm") return val * 1e2; + if (unit=="km") return val * 1e-3; + if (unit=="sunradius") return val / GYOTO_SUN_RADIUS; + if ((unit=="astronomicalunit") || + (unit=="astronomical_unit") || + (unit=="AU") || + (unit=="au") || + (unit=="ua")) + return val / GYOTO_ASTRONOMICAL_UNIT; + if (unit=="ly") return val / GYOTO_LIGHT_YEAR; + if (unit=="pc") return val / GYOTO_KPC * 1e3; + if (unit=="kpc") return val / GYOTO_KPC; + if (unit=="Mpc") return val / GYOTO_KPC * 1e-3; + stringstream ss; + ss << "Unsupported conversion: \"" << unit; + throwError(ss.str()); + return 0; +# endif +} + +double Gyoto::Units::ToSeconds(double val, const string &unit, + const SmartPointer &gg) { +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + GYOTO_DEBUG_EXPR(val); + GYOTO_DEBUG_EXPR(unit); + GYOTO_DEBUG_EXPR(gg); + GYOTO_ENDIF_DEBUG +# endif + if (unit=="" || unit=="s") ; + else if (unit=="geometrical_time" || unit=="geometrical") { + if (unit=="geometrical") + GYOTO_WARNING << "Please use \"geometrical_time\" instead of " + "\"geometrical\" for time unit, \"geometrical\" in this context " + "is deprecated and will be removed soon"; + if (gg) val *= gg -> unitLength() / GYOTO_C ; + else + throwError("Metric required for geometrical_time -> second conversion"); + } +# ifdef HAVE_UDUNITS + else val = Second->To(val, unit); +# else + else if (unit=="min") val *= 60. ; + else if (unit=="h") val *= 3600. ; + else if (unit=="d") val *= 86400. ; + else if (unit=="yr") val *= 3.15576e+07; + else if (unit=="kyr") val *= 3.15576e+10; + else { + stringstream ss; + ss << "Screen::setTime(): unknown unit \"" << unit << "\". Accepted units: " + << "[s] geometrical min h d y"; + throwError (ss.str()); + } +# endif + return val; +} + +double Gyoto::Units::FromSeconds(double val, const string &unit, + const SmartPointer &gg) { + if (unit=="" || unit=="s") ; + else if (unit=="geometrical_time" || unit=="geometrical") { + if (unit=="geometrical") + GYOTO_WARNING << "Please use \"geometrical_time\" instead of " + "\"geometrical\" for time unit, \"geometrical\" in this context " + "is deprecated and will be removed soon"; + if (gg) val *= GYOTO_C / gg -> unitLength() ; + else + throwError("Metric required for second -> geometrical_time conversion"); + } +# ifdef HAVE_UDUNITS + else val = Second->From(val, unit); +# else + else if (unit=="min") val /= 60. ; + else if (unit=="h") val /= 3600. ; + else if (unit=="d") val /= 86400. ; + else if (unit=="yr") val /= 3.15576e+07; + else if (unit=="kyr") val /= 3.15576e+10; + else { + stringstream ss; + ss << "Screen::setTime(): unknown unit \"" << unit << "\". Accepted units: " + << "[s] geometrical min h d y"; + throwError (ss.str()); + } +# endif + return val; +} + +double Gyoto::Units::ToKilograms(double val, const string &unit) +{ +# ifdef HAVE_UDUNITS + if (unit=="" || unit=="kg") return val; + return KiloGram->To(val, unit); +# else + if (unit=="" || unit=="kg") ; // do nothing ! + else if (unit=="sunmass") val *= GYOTO_SUN_MASS; + else if (unit=="g") val*= 1e-3; + else { + stringstream ss; + ss << "Unsupported mass unit: \"" << unit + << "\". Supported units: [kg] g sunmass"; + throwError(ss.str()); + } + return val; +# endif +} + +double Gyoto::Units::FromKilograms(double val, const string &unit) +{ + if (unit=="" || unit=="kg") return val; +# ifdef HAVE_UDUNITS + return KiloGram->From(val, unit); +# else + else if (unit=="sunmass") val /= GYOTO_SUN_MASS; + else if (unit=="g") val*= 1e3; + else { + stringstream ss; + ss << "Unsupported mass unit: \"" << unit + << "\". Supported units: [kg] g sunmass"; + throwError(ss.str()); + } + return val; +# endif +} + +double Gyoto::Units::ToGeometrical(double val, const string &unit, + const SmartPointer &gg) { + if (unit == "" || unit == "geometrical") return val; + if (!gg) throwError("Need Metric to convert to geometrical units"); + return ToMeters(val, unit) / gg->unitLength(); +} + +double Gyoto::Units::FromGeometrical(double val, const string &unit, + const SmartPointer &gg) { + if (unit == "" || unit == "geometrical") return val; + if (!gg) throwError("Need Metric to convert from geometrical units"); + return FromMeters(val * gg->unitLength(), unit); +} + +double Gyoto::Units::ToGeometricalTime(double val, const string &unit, + const SmartPointer &gg) { + if (unit == "" || unit == "geometrical_time") return val; + if (!gg) throwError("Need Metric to convert to geometrical units"); + return ToSeconds(val, unit) / gg->unitLength() * GYOTO_C; +} + +double Gyoto::Units::FromGeometricalTime(double val, const string &unit, + const SmartPointer &gg) { + if (unit == "" || unit == "geometrical_time") return val; + if (!gg) throwError("Need Metric to convert from geometrical units"); + return FromSeconds(val * gg->unitLength() / GYOTO_C, unit); +} + +double Gyoto::Units::ToHerz(double value, const string &unit) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "converting " << value << string(unit) << "to Herz" << endl; +# endif +# ifdef HAVE_UDUNITS + if (unit == "" || unit == "Hz") return value; + Unit from (unit), Hz("Hz"); + if (areConvertible(from, Hz)) + return Hz.To(value, from); + if (areConvertible(from, *Meter)) + return GYOTO_C/Meter->To(value, from); + Unit eV("eV"); + if (areConvertible(from, eV)) + return eV.To(value, from) * GYOTO_eV2Hz; + stringstream ss; + ss << "Units::ToHerz(): unknown unit \"" + << unit << "\"."; + throwError (ss.str()); +# else + GYOTO_WARNING_UDUNITS(unit, "Hz"); +# endif + return 0.; +} + +double Gyoto::Units::FromHerz(double value, const string &unit) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "converting " << value << "Hz to " << string(unit) << endl; +# endif +# ifdef HAVE_UDUNITS + if (unit == "" || unit == "Hz") return value; + Unit to(unit), Hz("Hz"); + if (areConvertible(to, Hz)) + return Hz.From(value, to); + if (areConvertible(to, *Meter)) + return Meter->From(GYOTO_C/value, to); + Unit eV("eV"); + if (areConvertible(to, eV)) + return eV.From(value / GYOTO_eV2Hz, to); + stringstream ss; + ss << "Units::ToHerz(): unknown unit \"" + << unit << "\"."; + throwError (ss.str()); +# else + GYOTO_WARNING_UDUNITS(unit, "Hz"); +# endif + return 0.; +} + +# ifdef HAVE_UDUNITS +bool Gyoto::Units::areConvertible(const Unit &unit1, + const Unit &unit2) { + return ut_are_convertible(unit1, unit2); +} +# endif diff -Nru gyoto-0.0.3/lib/Disk3D.C gyoto-0.1.0/lib/Disk3D.C --- gyoto-0.0.3/lib/Disk3D.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Disk3D.C 2013-07-27 09:14:20.000000000 +0000 @@ -113,12 +113,12 @@ throwError( "dimensions can't be null"); if (nr_==1 || nz_==1 || nphi_==1) throwError("In Disk3D::CopyEmissquant: dimensions should be >1"); - dr_ = (rout_ - rin_) / double(nr_-1.); - dz_ = (zmax_ - zmin_) / double(nz_-1.); + dr_ = (rout_ - rin_) / double(nr_-1); + dz_ = (zmax_ - zmin_) / double(nz_-1); if (repeat_phi_==0.) throwError("In Disk3D::CopyEmissquant: repeat_phi is 0!"); //dphi_ = 2.*M_PI/double((nphi_-1.)*repeat_phi_); - dphi_ = (phimax_-phimin_)/double((nphi_-1.)*repeat_phi_); + dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); GYOTO_DEBUG << "allocate emissquant_;" << endl; emissquant_ = new double[nel]; GYOTO_DEBUG << "pattern >> emissquant_" << endl; @@ -126,7 +126,7 @@ } } -double const * const Disk3D::getEmissquant() const { return emissquant_; } +double const * Disk3D::getEmissquant() const { return emissquant_; } void Disk3D::getEmissquantNaxes( size_t naxes[3] ) const { naxes[0] = nnu_; naxes[1] = nphi_; naxes[2] = nz_; @@ -149,12 +149,12 @@ memcpy(velocity_, velocity, 3*nphi_*nz_*nr_*sizeof(double)); } } -double const * const Disk3D::getVelocity() const { return velocity_; } +double const * Disk3D::getVelocity() const { return velocity_; } void Disk3D::repeatPhi(size_t n) { repeat_phi_ = n; - if ((nphi_-1.)*repeat_phi_>0.) - dphi_=(phimax_-phimin_)/double((nphi_-1.)*repeat_phi_); + if ((nphi_-1)*repeat_phi_>0.) + dphi_=(phimax_-phimin_)/double((nphi_-1)*repeat_phi_); //dphi_=2.*M_PI/double((nphi_-1.)*repeat_phi_); } @@ -168,37 +168,37 @@ void Disk3D::rin(double rrin) { rin_ = rrin; - if (nr_>1) dr_ = (rout_-rin_) / double(nr_-1.); + if (nr_>1) dr_ = (rout_-rin_) / double(nr_-1); } double Disk3D::rin() const {return rin_;} void Disk3D::rout(double rrout) { rout_ = rrout; - if (nr_>1) dr_ = (rout_-rin_) / double(nr_-1.); + if (nr_>1) dr_ = (rout_-rin_) / double(nr_-1); } double Disk3D::rout() const {return rout_;} void Disk3D::zmin(double zzmin) { zmin_ = zzmin; - if (nz_>1) dz_ = (zmax_-zmin_) / double(nz_-1.); + if (nz_>1) dz_ = (zmax_-zmin_) / double(nz_-1); } double Disk3D::zmin() const {return zmin_;} void Disk3D::zmax(double zzmax) { zmax_ = zzmax; - if (nz_>1) dz_ = (zmax_-zmin_) / double(nz_-1.); + if (nz_>1) dz_ = (zmax_-zmin_) / double(nz_-1); } double Disk3D::zmax() const {return zmax_;} -void Disk3D::phimin(double phimin) { - phimin_ = phimin; - if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1.); +void Disk3D::phimin(double phimn) { + phimin_ = phimn; + if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double Disk3D::phimin() const {return phimin_;} -void Disk3D::phimax(double phimax) { - phimax_ = phimax; - if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1.); +void Disk3D::phimax(double phimx) { + phimax_ = phimx; + if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double Disk3D::phimax() const {return phimax_;} @@ -311,15 +311,15 @@ if (nphi_==1) throwError("In Disk3D::fitsRead: dimensions should be >1"); //dphi_ = 2.*M_PI/double((nphi_-1.)*repeat_phi_); - dphi_ = (phimax_-phimin_)/double((nphi_-1.)*repeat_phi_); + dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); // update nz_, nr_, dz_, dr_ nz_ = naxes[2]; nr_ = naxes[3]; if (nr_==1 || nz_==1) throwError("In Disk3D::fitsRead: dimensions should be >1"); - dr_ = (rout_ - rin_) / double(nr_-1.); - dz_ = (zmax_ - zmin_) / double(nz_-1.); + dr_ = (rout_ - rin_) / double(nr_-1); + dz_ = (zmax_ - zmin_) / double(nz_-1); if (emissquant_) { delete [] emissquant_; emissquant_ = NULL; } emissquant_ = new double[nnu_ * nphi_ * nz_ * nr_]; @@ -368,7 +368,7 @@ char* pixfile = const_cast(filename_.c_str()); fitsfile* fptr = NULL; int status = 0; - long naxes [] = {nnu_, nphi_, nz_, nr_}; + long naxes [] = {long(nnu_), long(nphi_), long(nz_), long(nr_)}; long fpixel[] = {1,1,1,1}; char * CNULL=NULL; @@ -512,6 +512,7 @@ break; default: throwError("Disk3D::getIndices(): unknown COORDKIND"); + phi=zz=rr=0.; } if (dphi_*dz_*dr_==0.) @@ -585,8 +586,8 @@ ph->getCoord(index, coord1); ph->getCoord(index+1, coord2); - checkPhiTheta(coord1); - checkPhiTheta(coord2); + ph->checkPhiTheta(coord1); + ph->checkPhiTheta(coord2); // HEURISTIC TESTS TO PREVENT TOO MANY INTEGRATION STEPS // Speeds up a lot! @@ -669,7 +670,7 @@ ){//then out of grid indisk=0; }else{ //Inside grid: compute emission - checkPhiTheta(coord_ph_hit); + ph->checkPhiTheta(coord_ph_hit); for (int ii=0;ii<4;ii++) coord_obj_hit[ii]=coord_ph_hit[ii]; getVelocity(coord_obj_hit, coord_obj_hit+4); if (data) { @@ -686,9 +687,11 @@ } -int Disk3D::setParameter(std::string name, std::string content) { +int Disk3D::setParameter(std::string name, + std::string content, + std::string unit) { if (name == "File") fitsRead( content ); - else return Generic::setParameter(name, content); + else return Generic::setParameter(name, content, unit); return 0; } @@ -701,11 +704,11 @@ } void Disk3D::setParameters(FactoryMessenger* fmp) { - string name, content; + string name, content, unit; setMetric(fmp->getMetric()); - while (fmp->getNextParameter(&name, &content)) { - if (name == "File") setParameter(name, fmp -> fullPath(content)); - else setParameter(name, content); + while (fmp->getNextParameter(&name, &content, &unit)) { + if (name == "File") setParameter(name, fmp -> fullPath(content), unit); + else setParameter(name, content, unit); } } #endif diff -Nru gyoto-0.0.3/lib/Disk3D_BB.C gyoto-0.1.0/lib/Disk3D_BB.C --- gyoto-0.0.3/lib/Disk3D_BB.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Disk3D_BB.C 2013-07-27 09:14:20.000000000 +0000 @@ -69,16 +69,13 @@ delete [] velocity_array_; } -double const * const Disk3D_BB::getVelocity() const { return Disk3D::getVelocity(); } +double const * Disk3D_BB::getVelocity() const { return Disk3D::getVelocity(); } void Disk3D_BB::copyQuantities(int iq) { if (iq<1 || iq>nb_times_) throwError("In Disk3D_BB::copyQuantities: incoherent value of iq"); - double * curem = temperature_array_[iq-1], - * curvel = velocity_array_[iq-1]; - - setEmissquant(curem); - setVelocity(curvel); + setEmissquant(temperature_array_[iq-1]); + setVelocity(velocity_array_[iq-1]); } void Disk3D_BB::getVelocity(double const pos[4], double vel[4]) { @@ -90,6 +87,7 @@ break; default: throwError("Disk3D_BB::getVelocity: bad COORDKIND"); + risco=0.; } if (rcur rout() || rcur < risco) return 0.; + size_t i[4]; // {i_nu, i_phi, i_z, i_r} getIndices(i,co,nu); size_t naxes[4]; getEmissquantNaxes(naxes); size_t nnu=naxes[0], nphi=naxes[1], nz=naxes[2]; double TT = temperature[i[3]*nphi*nz*nnu+i[2]*nphi*nnu+i[1]*nnu+i[0]]; - //cout << "r T= "<< rcur << " " << TT << endl; + //This is local temperature in K + spectrumBB_->setTemperature(TT); double Iem=(*spectrumBB_)(nu); @@ -155,53 +158,54 @@ Ires=Iem; }else{ //SI value of cylindrical r coordinate: - double dist_unit = GYOTO_G_OVER_C_SQUARE*gg_->getMass(); - double th=co[2]; - //double rcur_cyl=rcur*sin(th); - double r_si=rcur*dist_unit; - double risco_si=risco*dist_unit; + double dist_unit = gg_->unitLength(); + //double r_si=rcur*dist_unit; //spherical + //double r_si=rcur*sin(th)*dist_unit; //cylindrical + //cout << "cyl: " << rcur << " " << th << " " << rcur*sin(th) << " " << risco << endl; + //double risco_si=risco*dist_unit; + //Local density in cgs: + /* + Following fact (in SI units) is defined by: + fact=RR/(Mm*kappa*gamma) + with: + RR=8.3144621; // Perfect gas constant in SI + Mm=6e-4; //This is N_avogadro*M_atomicmassunit/gamma in kg/mol + kappa=3e10; // p = kappa*density^gamma + gamma=1.66667; + [see DynaDisk3D.i] + */ + double fact=2.77149e-07; + //See DynaDisk3D.i, or paper, for relation between TT and density + double density=pow(fact*TT,1.5);// 1.5 is 1/(gamma-1) + //density is in SI units, kg/m^3 + /*** Computing emission coef: ***/ - //Over a sphere: - //double jnu=3.*M_PI/r_si*Iem; - //last value obtained by using the same reasoning as in Narayan&Yi - //1995, ApJ 452, 710, - //Eq. (3.13): jnu*4/3Pi*r^3=Pi*Bnu(T)*4Pi*r^2 - /*double Vem = 4./3.*M_PI*r_si*r_si*r_si - - 4./3.*M_PI*risco_si*risco_si*risco_si; - double Sem = 4.*M_PI*r_si*r_si; - if (Vem<=0.) throwError("In Disk3D_BB::emission1date: bad case" - " for heuristic computation of jnu");*/ - - //Over a cylinder: - /*double height=2.*0.2*risco_si;//disk height in SI - double Vem = M_PI*height*(r_si*r_si-risco_si*risco_si); - double Sem = 2.*M_PI*(r_si*height+r_si*r_si-risco_si*risco_si); - */ + //Emission coef jnu for thermal bremsstrahlung (see RybickiLightman 5.14a) - //Over a 'napkin ring': - double height=zmax()*dist_unit;//disk half-height in SI - //Volume of napkin ring of (spherical) radius risco to r - //See wikipedia "Spherical cap" - double Vem = 2.*M_PI*height*(r_si*r_si-risco_si*risco_si); - double Sem = 2.*M_PI*(r_si*r_si+2.*r_si*height-risco_si*risco_si); - if (Vem<=0. || Sem<0. - || Vem!=Vem - || Sem!=Sem){ - cout << "At r,th= " << rcur << " " << th << endl; - cout << "Sem, Vem= " << Sem << " " << Vem << endl; - throwError("In Disk3D_BB::emission1date: bad case" - " for heuristic computation of jnu"); - } - double jnu = Sem/Vem*Iem; + /* + fact2=1/4pi * 2^5*pi*e^6/(3*me*c^3) * sqrt(2pi/(3*kB*me)) * 1/mu^2 + in SI, with: me=electron mass, e=electron charge, kB=boltzman, + mu=atomic mass unit + Anyway this factor has no importance, + we are interested in relative values + */ + double fact2=7.83315e-12; + double hok=4.79924e-11; //planck cst / boltzman cst + double jnu = fact2 * 1./sqrt(TT) * density*density + * exp(-hok*nu/TT); //Elementary intensity added by current dsem segment of worldline //in SI units: Ires=jnu*dsem*dist_unit; - // cout << "Thin: " << Iem << " " << dsem << " " << coord_ph[1] << " " << dsem/coord_ph[1] << endl; + //cout << "at end emission1date nu jnu deltaI= " << nu << " " << jnu << " " << Ires << endl; + + //cout << rcur << " " << TT << endl; + //cout << Iem << " " << Sem/Vem << " " << dsem << " " << Ires << endl; + //cout << "stuff 3D= " << TT << " " << Iem << " " << Ires << " " << jnu << " " << Sem/Vem << " " << dsem << endl; } - + return Ires; } @@ -216,23 +220,104 @@ tcomp+=dt_; ifits++; } - double* fake; if (ifits==1 || ifits==nb_times_){ const_cast(this)->copyQuantities(ifits); //awful trick to avoid problems with constness of function emission -> to improve - return emission1date(nu,dsem,fake,co); + return emission1date(nu,dsem,NULL,co); }else{ double I1, I2; const_cast(this)->copyQuantities(ifits-1); - I1=emission1date(nu,dsem,fake,co); + I1=emission1date(nu,dsem,NULL,co); const_cast(this)->copyQuantities(ifits); - I2=emission1date(nu,dsem,fake,co); + I2=emission1date(nu,dsem,NULL,co); double t1 = tinit_+(ifits-2)*dt_; return I1+(I2-I1)/dt_*(time-t1); } - + return 0.; } +double Disk3D_BB::transmission1date(double nu, double dsem, + double*, + double co[8]) const{ + GYOTO_DEBUG << endl; + double * temperature = const_cast(getEmissquant()); + + double dist_unit = GYOTO_G_OVER_C_SQUARE*gg_->getMass(); + + double risco; + switch (gg_->getCoordKind()) { + case GYOTO_COORDKIND_SPHERICAL: + risco = static_cast >(gg_) -> getRms(); + break; + default: + throwError("Disk3D_BB::emission1date(): bad COORDKIND" + ", should be BL corrdinates"); + risco=0.; + } + + double rcur=co[1]; + //double th=co[2]; + + //cout << "rcur, risco= " << rcur << " " << risco << endl; + + if (rcur > rout() || rcur < risco) return 0.; + + size_t i[4]; // {i_nu, i_phi, i_z, i_r} + getIndices(i,co,nu); + size_t naxes[4]; + getEmissquantNaxes(naxes); + size_t nnu=naxes[0], nphi=naxes[1], nz=naxes[2]; + double TT = temperature[i[3]*nphi*nz*nnu+i[2]*nphi*nnu+i[1]*nnu+i[0]]; + //This is local temperature in K + + spectrumBB_->setTemperature(TT); + double BnuT=(*spectrumBB_)(nu); //Planck function + double jnu=emission1date(nu,dsem,NULL,co); // Emission coef + double alphanu=0.; //absorption coef. + if (BnuT==0.){ + /* + BnuT can be 0 in the region close to ISCO where density + decreases very fast. Then jnu should be 0 too (density~0). + If both are 0, then nothing happens (no absorption, no emission, + it's free space). Thus leave alphanu=0. + If jnu!=0 then alphanu is not defined, this should not happen. + */ + if (jnu!=0.) + throwError("In Disk3D_BB::transmission1date absorption coef. undefined!"); + }else{ + alphanu=jnu/BnuT; + } + //cout << "at end transmission1date nu alphanu argexp= " << nu << " " << TT << " " << jnu << " " << BnuT << " " << exp(-alphanu*dsem*dist_unit) << endl; + //Thermal emission assumed, use Kirchhoff alphanu=jnu/Bnu + return exp(-alphanu*dsem*dist_unit); +} + +double Disk3D_BB::transmission(double nuem, double dsem, double* co) const { + + GYOTO_DEBUG << endl; + double time = co[0], tcomp=tinit_; + int ifits=1; + while(time>tcomp && ifits(this)->copyQuantities(ifits); //awful trick to avoid problems with constness of function transmission -> to improve + return transmission1date(nuem,dsem,NULL,co); + }else{ + double I1, I2; + const_cast(this)->copyQuantities(ifits-1); + I1=transmission1date(nuem,dsem,NULL,co); + const_cast(this)->copyQuantities(ifits); + I2=transmission1date(nuem,dsem,NULL,co); + double t1 = tinit_+(ifits-2)*dt_; + return I1+(I2-I1)/dt_*(time-t1); + } + + return double(flag_radtransf_); +} + + void Disk3D_BB::setMetric(SmartPointer gg) { //Metric must be KerrBL (see emission function) string kind = gg->getKind(); @@ -242,7 +327,9 @@ Disk3D::setMetric(gg); } -int Disk3D_BB::setParameter(std::string name, std::string content) { +int Disk3D_BB::setParameter(std::string name, + std::string content, + std::string unit) { if (name == "File") { dirname_ = new char[strlen(content.c_str())+1]; strcpy(dirname_,content.c_str()); @@ -273,8 +360,8 @@ temperature_array_ = new double*[nb_times_] ; velocity_array_ = new double*[nb_times_] ; - double nu0b, zminb, zmaxb, rinb, routb; - size_t nnub, nphib, nzb, nrb; + double nu0b=0., zminb=0., zmaxb=0., rinb=0., routb=0.; + size_t nnub=0, nphib=0, nzb=0, nrb=0; for (int i=1; i<=nb_times_; i++) { ostringstream stream_name ; @@ -324,7 +411,7 @@ } else if (name=="tinit") tinit_=atof(content.c_str()); else if (name=="dt") dt_=atof(content.c_str()); - else return Disk3D::setParameter(name, content); + else return Disk3D::setParameter(name, content, unit); return 0; } diff -Nru gyoto-0.0.3/lib/DynamicalDisk.C gyoto-0.1.0/lib/DynamicalDisk.C --- gyoto-0.0.3/lib/DynamicalDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/DynamicalDisk.C 2013-07-27 09:14:20.000000000 +0000 @@ -72,19 +72,15 @@ delete [] nr_array_; } -double const * const DynamicalDisk::getVelocity() const { return PatternDiskBB::getVelocity(); } +double const * DynamicalDisk::getVelocity() const { return PatternDiskBB::getVelocity(); } void DynamicalDisk::copyQuantities(int iq) { if (iq<1 || iq>nb_times_) throwError("In DynamicalDisk::copyQuantities: incoherent value of iq"); - double * curem = emission_array_[iq-1], - * curop = NULL, //temporary - * curvel = velocity_array_[iq-1], - * curr = radius_array_[iq-1]; - - setEmission(curem); - setVelocity(curvel); - setRadius(curr); + + setEmission(emission_array_[iq-1]); + setVelocity(velocity_array_[iq-1]); + setRadius(radius_array_[iq-1]); } void DynamicalDisk::getVelocity(double const pos[4], double vel[4]) { @@ -121,16 +117,15 @@ tcomp+=dt_; ifits++; } - double* fake; if (ifits==1 || ifits==nb_times_){ const_cast(this)->copyQuantities(ifits); //awful trick to avoid problems with constness of function emission -> to improve - return PatternDiskBB::emission(nu,dsem,fake,co); + return PatternDiskBB::emission(nu,dsem,NULL,co); }else{ double I1, I2; const_cast(this)->copyQuantities(ifits-1); - I1=PatternDiskBB::emission(nu,dsem,fake,co); + I1=PatternDiskBB::emission(nu,dsem,NULL,co); const_cast(this)->copyQuantities(ifits); - I2=PatternDiskBB::emission(nu,dsem,fake,co); + I2=PatternDiskBB::emission(nu,dsem,NULL,co); double t1 = tinit_+(ifits-2)*dt_; return I1+(I2-I1)/dt_*(time-t1); } @@ -138,7 +133,9 @@ return 0.; } -int DynamicalDisk::setParameter(std::string name, std::string content) { +int DynamicalDisk::setParameter(std::string name, + std::string content, + std::string unit) { if (name == "File") { dirname_ = new char[strlen(content.c_str())+1]; strcpy(dirname_,content.c_str()); @@ -187,35 +184,35 @@ fitsRead(filename); size_t naxes[3]; getIntensityNaxes(naxes); - size_t nnu,nphi,nr, - nel = (nnu=naxes[0])*(nphi=naxes[1])*(nr=naxes[2]); + size_t nnu=naxes[0],nphi=naxes[1],nr=naxes[2]; + // nel = (nnu=naxes[0])*(nphi=naxes[1])*(nr=naxes[2]); size_t nel1=nnu*nphi*nr, nel2=2*nr*nphi; //save emission if (getIntensity()){ double * emtemp = const_cast(getIntensity()); emission_array_[i-1] = new double[nel1]; - for (int j=0;j(getOpacity()); opacity_array_[i-1] = new double[nel1]; - for (int j=0;j(getVelocity()); velocity_array_[i-1] = new double[nel2]; - for (int j=0;j(getGridRadius()); radius_array_[i-1] = new double[nr]; - for (int j=0;j #include +#include using namespace Gyoto; using namespace std; -//Error::Error( const char* m ) : message(m), errcode(0) { } -Error::Error( const std::string m ) : message(m), errcode(0) { } +Error::Error( const std::string m ) : message(m), errcode(EXIT_FAILURE) { } void Error::Report() const { cerr << message << endl; } @@ -32,12 +32,14 @@ //char const * const Error::get_message() const { return message; } std::string Error::get_message() const { return message; } -static GyotoErrorHandler_t * GyotoErrorHandler = NULL; +static Gyoto::Error::Handler_t * GyotoErrorHandler = NULL; -void Gyoto::setErrorHandler( GyotoErrorHandler_t* handler ) +void Gyoto::Error::setHandler( Gyoto::Error::Handler_t* handler ) { GyotoErrorHandler = handler ; } void Gyoto::throwError( const std::string m ) { - if (GyotoErrorHandler) (*GyotoErrorHandler)(m.c_str()); + if (GyotoErrorHandler) (*GyotoErrorHandler)(Error(m)); else throw Error(m); } + +Gyoto::Error::operator const char * () const { return message.c_str(); } diff -Nru gyoto-0.0.3/lib/Factory.C gyoto-0.1.0/lib/Factory.C --- gyoto-0.0.3/lib/Factory.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Factory.C 2013-07-27 09:14:20.000000000 +0000 @@ -17,18 +17,21 @@ along with Gyoto. If not, see . */ +#include "GyotoConfig.h" #ifdef GYOTO_USE_XERCES -#include -#include -#include +#include "GyotoFactory.h" +#include "GyotoFactoryMessenger.h" +#include "GyotoUtils.h" + #include #include #include -#include -#include -#include -#include + +#include "GyotoMetric.h" +#include "GyotoAstrobj.h" +#include "GyotoSpectrum.h" +#include "GyotoSpectrometer.h" #include #include @@ -41,8 +44,8 @@ using namespace xercesc; using namespace std; -#define dvalLength 21 -#define dfmt " %20.16g " +#define dvalLength 25 +#define dfmt " %.16g " #define d2txt(txt, val) sprintf( txt , dfmt, val) #define ifmt " %li " #define i2txt(txt, val) sprintf( txt, ifmt, val); @@ -241,6 +244,8 @@ delete result; } else MetricDOM = root_; + string Plugin = C(MetricDOM->getAttribute(X("plugin"))); + if (Plugin != "") loadPlugin(Plugin.c_str()); string Kind = C(MetricDOM->getAttribute(X("kind"))); FactoryMessenger fm(this, MetricDOM); @@ -273,6 +278,8 @@ tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } + string Plugin = C(tmpEl->getAttribute(X("plugin"))); + if (Plugin != "") loadPlugin(Plugin.c_str()); string AstrobjKind = Cs(tmpEl->getAttribute(X("kind"))); if (debug()) cout << "Astrobj kind : " << AstrobjKind << endl ; @@ -307,7 +314,7 @@ } FactoryMessenger fm(this, tmpEl); - photon_ = PhotonSubcontractor(&fm); + photon_ = Photon::Subcontractor(&fm); } return photon_; @@ -332,6 +339,8 @@ tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); delete result; } + string Plugin = C(tmpEl->getAttribute(X("plugin"))); + if (Plugin != "") loadPlugin(Plugin.c_str()); string Kind = Cs(tmpEl->getAttribute(X("kind"))); if (debug()) cout << "Spectrum kind : " << Kind << endl ; @@ -341,6 +350,36 @@ } +SmartPointer Factory::getSpectrometer(){ + + DOMXPathResult* result; + DOMElement *tmpEl; + + if (kind_=="Spectrometer") { + tmpEl = root_; + } else { + result=doc_->evaluate( + X(("/"+kind_+"/Spectrometer").c_str()), + root_, + resolver_, + DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, + NULL); + if (!result->getSnapshotLength()) + throwError("GYOTO error: an Spectrometer MUST be specified"); + tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); + delete result; + } + string Plugin = C(tmpEl->getAttribute(X("plugin"))); + if (Plugin != "") loadPlugin(Plugin.c_str()); + string Kind = + Cs(tmpEl->getAttribute(X("kind"))); + if (debug()) cout << "Spectrometer kind : " << Kind << endl ; + + FactoryMessenger fm(this, tmpEl); + return (*Spectrometer::getSubcontractor(Kind))(&fm); + +} + /// Scenery SmartPointer Factory::getScenery () { @@ -358,7 +397,7 @@ tmpEl = static_cast< xercesc::DOMElement* >(result -> getNodeValue()); FactoryMessenger fm(this, tmpEl); - scenery_ = ScenerySubcontractor(&fm); + scenery_ = Scenery::Subcontractor(&fm); delete result; } @@ -512,7 +551,7 @@ } -Factory::Factory(SmartPointer sp) +Factory::Factory(SmartPointer sp) : reporter_(NULL), parser_(NULL), resolver_(NULL), gg_el_(NULL), obj_el_(NULL), ph_el_(NULL), scenery_(NULL), gg_(NULL), obj_(NULL), @@ -727,7 +766,9 @@ curNodeIndex_=0; } -int FactoryMessenger::getNextParameter(std::string* namep, std::string* contp) +int FactoryMessenger::getNextParameter(std::string* namep, + std::string* contp, + std::string* unitp) { if (debug()) { @@ -749,9 +790,10 @@ = static_cast< xercesc::DOMElement* >( currentNode ); *namep = C(currentElement->getTagName()); *contp = C(currentElement->getTextContent()); + if (unitp) *unitp = C(currentElement->getAttribute(X("unit"))); return 1; } - return getNextParameter(namep, contp); + return getNextParameter(namep, contp, unitp); } FactoryMessenger* FactoryMessenger::makeChild(std::string name) { diff -Nru gyoto-0.0.3/lib/FixedStar.C gyoto-0.1.0/lib/FixedStar.C --- gyoto-0.0.3/lib/FixedStar.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/FixedStar.C 2013-07-27 09:14:20.000000000 +0000 @@ -39,8 +39,9 @@ FixedStar::FixedStar() : UniformSphere("FixedStar") { - if (debug()) - cerr << "DEBUG: in FixedStar::FixedStar(void)" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif for (int i=0;i<3;++i) pos_[i]=0.; } @@ -48,12 +49,14 @@ double rad) : UniformSphere("FixedStar", gg, rad) { - if (debug()) - cerr << "DEBUG: in FixedStar::FixedStar(metric, pos, rad)" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "(metric, pos, rad)" << endl; +# endif for (int i=0;i<3;++i) pos_[i] = StPsn[i]; setRadius(rad); - if (debug()) - cerr << "DEBUG: out FixedStar::FixedStar(metric, pos, rad)" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "done" << endl; +# endif } FixedStar::FixedStar(const FixedStar& orig) : @@ -64,9 +67,9 @@ FixedStar* FixedStar::clone() const { return new FixedStar(*this); } FixedStar::~FixedStar() { - - if (debug()) cout << "FixedStar Destruction" << endl; - +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } void FixedStar::getCartesian(double const * const , size_t const n_dates, @@ -86,13 +89,17 @@ double rs=pos_[0]; double ths=pos_[1]; double phs=pos_[2]; - xs= rs*sin(ths)*cos(phs); - ys= rs*sin(ths)*sin(phs); - zs= rs*cos(ths); + double st, ct, sp, cp; + sincos(ths, &st, &ct); + sincos(phs, &sp, &cp); + xs= rs*st*cp; + ys= rs*st*sp; + zs= rs*ct; } break; default: throwError("unsupported coordkind"); + xs=ys=zs=0.; } for (size_t i=0; i gg) { - if (debug()) - cerr << "DEBUG: in FixedStar::setMetric(gg)\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif Generic::setMetric(gg); setRadius(radius_); } void FixedStar::setRadius(double r) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(r) ; +# endif radius_ = r; critical_value_=r*r; safety_value_=1.1*critical_value_; if (!gg_()) { - if (debug()) - cerr << "DEBUG: FixedStar::setRadius(radius): metric is not set yet\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "metric is not set yet" << endl; +# endif return; } switch (gg_ -> getCoordKind()) { @@ -145,13 +157,13 @@ void FixedStar::setPos(const double p[3]) { for (int i=0; i<3; ++i) pos_[i]=p[i]; setRadius(radius_);} -int FixedStar::setParameter(string name, string content) { +int FixedStar::setParameter(string name, string content, string unit) { if (name=="Position") { char* tc = const_cast(content.c_str()); double pos[3]; for (int i=0;i<3;++i) pos[i] = strtod(tc, &tc); setPos(pos); - } else return UniformSphere::setParameter(name, content); + } else return UniformSphere::setParameter(name, content, unit); return 0; } diff -Nru gyoto-0.0.3/lib/FocalPlane.C gyoto-0.1.0/lib/FocalPlane.C --- gyoto-0.0.3/lib/FocalPlane.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/FocalPlane.C 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -/* - Copyright 2011 Frederic Vincent, Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - -#include -using namespace Gyoto; - -FocalPlane::FocalPlane(SmartPointer gg, SmartPointer obj, - double xmin, double ymin, - size_t nx, size_t ny, double dx, double dy): - gg_(gg), obj_(obj), - nx_(nx), ny_(ny), dx_(dx), dy_(dy), - xmin_(xmin), ymin_(ymin) -{ - -} - -FocalPlane::FocalPlane(SmartPointer gg, SmartPointer obj, - double xmin, double ymin, double xmax, double ymax, - size_t nx, size_t ny): - gg_(gg), obj_(obj), - nx_(nx), ny_(ny), dx_((xmax-xmin)/nx), dy_((ymax-ymin)/ny), - xmin_(xmin), ymin_(ymin) -{ - -} - -FocalPlane::~FocalPlane() {} - -size_t FocalPlane::getNx() const { return nx_; } -size_t FocalPlane::getNy() const { return ny_; } -double FocalPlane::getDx() const { return dx_; } -double FocalPlane::getDy() const { return dy_; } -double FocalPlane::getXmin() const { return xmin_; } -double FocalPlane::getYmin() const { return ymin_; } -double FocalPlane::getXmax() const { return xmin_+(nx_-1)*dx_; } -double FocalPlane::getYmax() const { return ymin_+(ny_-1)*dy_; } -void FocalPlane::getX(double * dest) const { - size_t i; for (i=0; i getDistance() * N * obj_->getRmax(); - -// for (j=0; jgetObserverCoord(tobs, x, y, coord, sys); -// ph.setInitialCondition(gg, obj, coord, deltatau, sys); -// dest[j*nx+i]=ph.hit(obj->getTmin()); -// } -// } -// } diff -Nru gyoto-0.0.3/lib/Functors.C gyoto-0.1.0/lib/Functors.C --- gyoto-0.0.3/lib/Functors.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/Functors.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,93 @@ +/* + Copyright 2012 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include "GyotoFunctors.h" +#include "GyotoError.h" +#include +#include +#include + +#define dr_tol 1e-5 +#define f_tol 1e-9 +#define sign(a) (a>=0?1:-1) + +double Gyoto::Functor::Double_Double_const::ridders(double r1, double r2) const +{ + // Ridders' root-finding method applied to operator() + double val1 = operator()(r1); + double val2 = operator()(r2); + double r3, r4, val3, val4; + + do { + r3 = 0.5*(r1+r2); + val3 = operator()(r3); + + r4 = r3+(r3-r1) * sign(val1-val2)*val3/sqrt(val3*val3-val1*val2); + val4 = operator()(r4); + + if (sign(val3)!=sign(val4)) { + // use r3 and r4 for next iteration + r1=r3; val1=val3; + r2=r4; val2=val4; + } else if (sign(val1) != sign(val4)) { + // use r1 and r4 for next iteration + r2=r4; val2=val4; + } else { + // use r4 and r2 for next iteration + r1=r4; val1=val4; + } + + } while (fabs(r1-r2) >= dr_tol && fabs(val4) > f_tol) ; + + return r4; +} + +double Gyoto::Functor::Double_Double_const::secant(double r1, double r2) +{ + // Secant root-finding method applied to operator() + double val1 = operator()(r1); + double val2 = operator()(r2); + double r3, val3=DBL_MAX; + unsigned int maxiter=20, iter; + + for (iter = 0; iter < maxiter; ++iter) { + r3=r1-val1*(r2-r1)/(val2-val1); + val3 = operator()(r3); + + if (fabs(r2-r3) <= fabs(r1-r3)) { + r1=r3; val1=val3; + } else { + r2=r3; val2=val3; + } + + if ( (fabs(r1-r2) < dr_tol) || (fabs(val3) < f_tol) ) break; + if (val2==val1) { + status=1; + return r3; + } + } + + if (iter==maxiter) { + status=2; + return r3; + } + + status=0; + return r3; +} diff -Nru gyoto-0.0.3/lib/Hooks.C gyoto-0.1.0/lib/Hooks.C --- gyoto-0.0.3/lib/Hooks.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/Hooks.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,96 @@ +/* + Copyright 2012 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include "GyotoHooks.h" +#include "GyotoDefs.h" +#include "GyotoUtils.h" +#include +#include + +using namespace Gyoto; +using namespace Gyoto::Hook; + +//////// LOCAL TO THIS FILE //////// +/* LISTENER LIST */ +class Gyoto::Hook::Teller::ListenerItem { + friend class Gyoto::Hook::Teller; + friend class Gyoto::Hook::Listener; + protected: + Listener * listener; + ListenerItem * next; + public: + ListenerItem(Listener*, ListenerItem*); + ~ListenerItem(); + virtual void tell(Gyoto::Hook::Teller *); + size_t len() const; +}; + +Teller::ListenerItem::ListenerItem(Listener*hear, ListenerItem * nxt) + : listener(hear), next(nxt) {} +Teller::ListenerItem::~ListenerItem() {if (next) delete next;} + +void Teller::ListenerItem::tell(Teller * teller) { + GYOTO_DEBUG<tell(teller); + if (next) next->tell(teller); +} + +size_t Teller::ListenerItem::len() const { + size_t l = 1; + if (next) l += next->len(); + return l; +} +///////////////////////////////////// + + +/* LISTENER */ +Listener::Listener() {} +Listener::~Listener() {} +void Listener::tell(Teller *) {}; + +/* TELLER */ +Teller::Teller() : listeners_(0) {} +Teller::Teller(const Teller &o) : listeners_(0) {} +Teller::~Teller() {if (listeners_) delete listeners_;} +void Teller::hook(Listener * hear) +{ + GYOTO_DEBUG <<"new hook: "<< hear <<" for Teller " << this << std::endl; + listeners_ = new ListenerItem(hear, listeners_); +} + +void Teller::unhook(Listener * hear) { + GYOTO_DEBUG <<"removing hook: "<< hear <<" from Teller " << this << std::endl; + ListenerItem * item = listeners_; + ListenerItem ** parent = &listeners_; + while (item) { + if (item->listener==hear) { + *parent=item->next; + item->next=0; + delete item; + item=*parent; + } else { + parent=&(item->next); + item=item->next; + } + } +} + +void Teller::tellListeners() { if (listeners_) listeners_->tell(this); } + + diff -Nru gyoto-0.0.3/lib/KerrBL.C gyoto-0.1.0/lib/KerrBL.C --- gyoto-0.0.3/lib/KerrBL.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/KerrBL.C 2013-07-27 09:14:20.000000000 +0000 @@ -78,7 +78,7 @@ } KerrBL::KerrBL(double a, double m) : - Generic(m, GYOTO_COORDKIND_SPHERICAL), spin_(a) + Generic(m, GYOTO_COORDKIND_SPHERICAL), spin_(a) { //DEBUG!!! //spin_=0.; @@ -89,13 +89,16 @@ } // default copy constructor should be fine -//KerrBL::KerrBL(const KerrBL& gg) : Metric(gg), spin_(gg.spin_) {setKind("KerrBL");} +KerrBL::KerrBL(const KerrBL& gg) : Metric::Generic(gg), spin_(gg.spin_) +{setKind("KerrBL");} KerrBL * KerrBL::clone () const { return new KerrBL(*this); } KerrBL::~KerrBL() { - if (debug()) cerr << "In KerrBL destructor" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } // Output @@ -112,7 +115,10 @@ */ // Mutators -void KerrBL::setSpin(const double spin) { spin_=spin; } +void KerrBL::setSpin(const double spin) { + spin_=spin; + tellListeners(); +} // Accessors double KerrBL::getSpin() const { return spin_ ; } @@ -131,26 +137,52 @@ return 2.-spin_+2.*sqrt(1.-spin_); } -//Computation of metric coefficients +//Computation of metric coefficients in covariant form double KerrBL::gmunu(const double * pos, int mu, int nu) const { double r = pos[1]; - double theta = pos[2]; + double sth2, cth2; + sincos(pos[2], &sth2, &cth2); + sth2*=sth2; cth2*=cth2; double r2=r*r; double a2=spin_*spin_; - double rho2=r2+a2*pow(cos(theta),2); -// if (debug()) { -// cerr << "DEBUG: KerrBL::gmunu: SPIN="<< spin_ << ", R=" << r << ", THETA=" << theta<< endl; -// } - - if ((mu==0) && (nu==0)) return -(1.-2.*r/rho2); // 2*r*mass - if ((mu==1) && (nu==1)) return rho2/(r2-2.*r+a2); - if ((mu==2) && (nu==2)) return rho2; + double sigma=r2+a2*cth2; + double delta=r2-2.*r+a2; - double sth2= sin(theta); sth2*=sth2; // = sin2(theta) + if ((mu==0) && (nu==0)) return -(1.-2.*r/sigma); + if ((mu==1) && (nu==1)) return sigma/delta; + if ((mu==2) && (nu==2)) return sigma; if ((mu==3) && (nu==3)) - return (r2+a2+2.*r*a2*sth2/rho2)*sth2; // 2*r*mass - if (((mu==0) && (nu==3)) || ((mu==3) && (nu==0))) - return -2*spin_*r*sth2/rho2; //2*r*mass + return (r2+a2+2.*r*a2*sth2/sigma)*sth2; + if (((mu==0) && (nu==3)) || ((mu==3) && (nu==0))){ + return -2*spin_*r*sth2/sigma; + } + + return 0.; +} + +//Computation of metric coefficients in contravariant form +double KerrBL::gmunu_up(const double * pos, int mu, int nu) const { + double r = pos[1]; + double sth2, cth2; + sincos(pos[2], &sth2, &cth2); + sth2*=sth2; cth2*=cth2; + double r2=r*r; + double a2=spin_*spin_; + double sigma=r2+a2*cth2; + double delta=r2-2.*r+a2; + double xi=(r2+a2)*(r2+a2)-a2*delta*sth2; + + if ((mu==0) && (nu==0)) { + return -xi/(delta*sigma); + } + if ((mu==1) && (nu==1)) return delta/sigma; + if ((mu==2) && (nu==2)) return 1./sigma; + if ((mu==3) && (nu==3)) { + return (delta-a2*sth2)/(sigma*delta*sth2); + } + if (((mu==0) && (nu==3)) || ((mu==3) && (nu==0))){ + return -2*spin_*r/(sigma*delta); + } return 0.; } @@ -164,21 +196,21 @@ // Optimized version double KerrBL::ScalarProd(const double* pos, const double* u1, const double* u2) const { - if (debug()) { - cerr << "DEBUG: KerrBL::ScalarProd(pos=[" << pos[0]; - for (int i=1; i<4; ++i) cerr << ", " << pos[i]; - cerr << "], u1=[" << u1[0]; - for (int i=1; i<4; ++i) cerr << ", " << u1[i]; - cerr << "], u2=[" << u2[0]; - for (int i=1; i<4; ++i) cerr << ", " << u2[i]; - cerr << "])=" << (gmunu(pos,0,0)*u1[0]*u2[0] +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + GYOTO_DEBUG_ARRAY(pos, 4); + GYOTO_DEBUG_ARRAY(u1, 4); + GYOTO_DEBUG_ARRAY(u2, 4); + GYOTO_DEBUG << "ScalarProd(pos, u1, u2)=" + << (gmunu(pos,0,0)*u1[0]*u2[0] +gmunu(pos,1,1)*u1[1]*u2[1] +gmunu(pos,2,2)*u1[2]*u2[2] +gmunu(pos,3,3)*u1[3]*u2[3] +gmunu(pos,0,3)*u1[0]*u2[3] +gmunu(pos,3,0)*u1[3]*u2[0]) << endl; - } + GYOTO_ENDIF_DEBUG +# endif return gmunu(pos,0,0)*u1[0]*u2[0] +gmunu(pos,1,1)*u1[1]*u2[1] @@ -196,11 +228,12 @@ */ int KerrBL::diff(const double* coordGen, const double* cst, double* res) const{ double a=spin_; + double a2=a*a; //int width=25;//15; //int prec=15;//8; - double rsink=1.+sqrt(1.-a*a)+drhor; + double rsink=1.+sqrt(1.-a2)+drhor; double r = coordGen[1] ; @@ -211,91 +244,122 @@ } if (r < rsink) { - if (debug()) cerr << "Too close to horizon in KerrBL::diff at r= " << r << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "Too close to horizon in KerrBL::diff at r= " << r << endl; +# endif return 1; } double r2 = r*r ; double r3 = r2*r ; + + // compute and store efficiently sin, cos, cotan double theta=coordGen[2]; - double costheta2=pow(cos(theta),2); - double tantheta=tan(theta); + double costheta, sintheta; + sincos(theta, &sintheta, &costheta); + double costheta2=costheta*costheta; + if (sintheta==0.) throwError("sintheta==0"); + double cotantheta=costheta/sintheta; + double cotantheta2=cotantheta*cotantheta; + double cotantheta3=cotantheta2*cotantheta; + double sin2theta=2.*sintheta*costheta; + double cos2theta=2.*costheta2-1.; + double pr=coordGen[5]; double ptheta=coordGen[6]; - double a2=a*a; double a3=a2*a; double Sigma=r2+a2*costheta2; + if (Sigma==0) throwError("In KerrBL::diff(): Sigma==0"); + double Sigmam1=1./Sigma; + double Sigmam2=Sigmam1*Sigmam1; + double Delta=r2-2*r+a2; double E=cst[1]; double E2=E*E; double L=cst[2]; double L2=L*L; + double tmp1=(2.*Delta*Sigma); + if (tmp1==0) throwError("In KerrBL::diff(): 2.*Delta*Sigma==0"); + double tmp1m1=1./tmp1; if (Delta==0) throwError("In KerrBL::diff(): Delta==0"); - if (Sigma==0) throwError("In KerrBL::diff(): Sigma==0"); - if (tmp1==0) throwError("In KerrBL::diff(): 2.*Delta*Sigma==0"); - if (tantheta==0) throwError("In KerrBL::diff(): tantheta==0"); - double cotantheta=1./tantheta; //caution, may become high if theta close to 0 //NB: equations of motion are independent of Carter constant in this //form. However, the dependency of the dynamic on this constant //appears when transforming from principal momenta to coordinate //derivatives (e.g. p_theta -> thetadot) - res[0] = 1./tmp1*(2.*(r*(-2.*a*L+E*r3+a2*E*(2.+r))+a2*E*(a2+r*(-2.+r))*costheta2));// tdot - - res[1] = Delta/Sigma*pr; //rdot - res[2] = 1./Sigma*ptheta; //thetadot - - res[3] = -1./tmp1*(-2.*(r*(2.*a*E+L*(-2.+r))+L*(a2+r*(-2.+r))*cotantheta*cotantheta)); //phidot + /* + ---> Standard Kerr equations of geodesics + */ + res[0] = tmp1m1*(2.*(r*(-2.*a*L+E*r3+a2*E*(2.+r))+a2*E*(a2+r*(-2.+r)) + *costheta2));// tdot - res[4] = 0.;// ptdot : pt = cst = -E - - res[5] = -0.5*(2.*(r*(r-a2)-a2*(1.-r)*costheta2) - /pow(r2+a2*costheta2,2))*pr*pr - -0.5*(-2.*r/pow(r2+a2*costheta2,2))*ptheta*ptheta - +(1./pow((a2+r*(-2.+r))*(r2+a2*costheta2),2) + res[1] = Delta*Sigmam1*pr; //rdot + + res[2] = Sigmam1*ptheta; //thetadot + + res[3] = -tmp1m1*(-2.*(r*(2.*a*E+L*(-2.+r))+L*(a2+r*(-2.+r)) + *cotantheta2)); //phidot + + res[4] = 0.;// ptdot: pt = cst = -E + + double tmp2=r2+a2*costheta2; + if (tmp2==0) throwError("r2+a2*costheta2==0"); + double tmp2m2=1./(tmp2*tmp2); + + double tmp3=a2+r*(-2.+r); + double tmp3_2=tmp3*tmp3; + + res[5] = + -0.5*(2.*(r*(r-a2)-a2*(1.-r)*costheta2)*tmp2m2)*pr*pr + -0.5*(-2.*r*tmp2m2)*ptheta*ptheta + +(tmp2m2/tmp3_2 *(a2*(a2*a2*E2-2.*a3*E*L+2.*a*E*L*r2+E2*r3*(-4.+r) +a2*(L2*(1.-r)+2*E2*r2))*costheta2 +r*(-r*(a2*a2*E2-2.*a3*E*L+2.*a*E*L*(4.-3.*r)*r - +a2*(L2+2.*E2*r*(-2.+r))+r*(E2*r3-L2*pow((-2.+r),2))) - +L2*pow(a2+r*(-2.+r),2)*cotantheta*cotantheta)));// prdot - - + +a2*(L2+2.*E2*r*(-2.+r))+r*(E2*r3-L2*(-2.+r)*(-2.+r))) + +L2*tmp3_2*cotantheta2)));// prdot + res[6]= - -0.5*((a2*Delta*sin(2*theta))/(Sigma*Sigma))*pr*pr - -0.5*(a2*sin(2*theta)/(Sigma*Sigma))*ptheta*ptheta + -0.5*(a2*Delta*sin2theta*Sigmam2)*pr*pr + -0.5*(a2*sin2theta*Sigmam2)*ptheta*ptheta +( - 1./( Delta*Sigma*Sigma ) - *( - L2*r2*Delta*cotantheta - +0.5*L2*Delta*(a2+2.*r2+a2*cos(2.*theta))*cotantheta*cotantheta*cotantheta - +a2*r*(2.*a2*E2-4.*a*E*L+L2*(2.-r)+2.*E2*r2)*cos(theta)*sin(theta) - ) + Sigmam2 + *( + L2*r2*cotantheta + +0.5*L2*(a2+2.*r2+a2*cos2theta)*cotantheta3 + +a2*r*(2.*a2*E2-4.*a*E*L+L2*(2.-r)+2.*E2*r2)*costheta*sintheta/Delta + ) ); // pthetadot - - res[7] = 0.;//pphi = cst = L + + res[7] = 0.;//pphidot: pphi = cst = L return 0; } void KerrBL::circularVelocity(double const coor[4], double vel[4], double dir) const { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG<<"coor=["< principal momenta*/ double coor[8], res_mom[8] ; double const * const cst = line -> getCst(); - if (debug()) - cerr << "DEBUG: KerrBL::myrk4(): cst=[" << cst[0] - << ", " << cst[1] << ", " << cst[2] << "]\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_ARRAY(cst,3); +#endif MakeMomentum(coordin,cst,coor); double k1[8] ; @@ -391,6 +455,8 @@ /*Switch principal momenta -> BL */ MakeCoord(res_mom,cst,res); + + // line -> checkPhiTheta(res); return 0; } @@ -522,13 +588,12 @@ double , double , double coordout1[8], double h0, double& h1) const { - /*Switch BL -> principal momenta*/ + double coor[8], coor1[8], cstest[5], coorhalf[8], coor2[8], coor1bis[8], mycoor[8], delta1[8]; double const * const cst = line -> getCst(); MakeMomentum(coordin,cst,coor); - double delta0[8], dcoor[8]; double delta0min=1e-15, eps=0.0001, S=0.9, errmin=1e-6, hbis=0.5*h0, err, h1min=0.01, h1max=coor[1]*0.5, diffr, diffth, difftol=0.01, normtemp, @@ -540,14 +605,18 @@ rtol=factrtol*(1.+sqrt(1.-a*a)), rlimitol=10.; if (coor[1] < rtol) cstol = cstol_hor; - // for tests of cst of motion conservation; don't ask too much - // if near horizon... + // for tests of cst of motion conservation; don't ask too much + // if near horizon... else cstol = cstol_gen; - if (fabs(fmod(coor[2]+M_PI/2, M_PI)-M_PI/2) < GYOTO_MIN_THETA) { - if (debug()) - cerr << "WARNING: Too close to Z axis: stopping integration"<< endl; - return 1;} + //NB: following test ok only if theta is 0-pi + // coz -pi/2[pi]=-pi/2 ... + /*if (fabs(fmod(coor[2]+M_PI/2, M_PI)-M_PI/2) < GYOTO_MIN_THETA) { + cout << "in kerr th= " << coor[2] << endl; + GYOTO_WARNING << "Too close to Z axis: stopping integration"<< endl; + return 1; + }*/ + //Fred: Test removed Feb 2013, seems not necessary if (diff(coor,cst,dcoor)) return 1 ; @@ -565,6 +634,8 @@ (coordinate singularity in BL) and whether we are outside horizon. */ + + double hinit=h0, steptol=1e3; while ( (( (rk1 =myrk4(coor,cst,h0,coor1) ) == 1) || (rk1 == 2)) || (( (rkhalf=myrk4(coor,cst,hbis,coorhalf) ) == 1) || (rkhalf == 2)) || @@ -578,13 +649,18 @@ zaxis=1; h0*=1.1; hbis*=1.1; - if (debug()) - cerr << "NOTE: Passing close to z-axis at theta= " - << coor[2] << " and r= " << coor[1] - << ", jumping ahead with h0= " << h0 << endl; - //throwError("stop"); - + GYOTO_INFO << "NOTE: Passing close to z-axis at theta= " + << coor[2] << " and r= " << coor[1] + << ", jumping ahead with h0= " << h0 << endl; + + if (h0/hinit>steptol){ + GYOTO_SEVERE << "In KerrBL::myrk4_adaptive: " + "stop integration because unsolved z-axis problem" << endl; + return 1; + } + + } @@ -593,10 +669,9 @@ // infinite jumping ahead behavior (should never happen of // course) - if (verbose() >= GYOTO_SEVERE_VERBOSITY) - cerr << "WARNING: " << endl - << "in KerrBL.C couldn't solve z-axis problem ; stopping..." - << endl; + GYOTO_INFO << "WARNING: " << endl + << "in KerrBL.C couldn't solve z-axis problem ; stopping..." + << endl; return 1; } @@ -676,17 +751,18 @@ } } if (coor1[1]= GYOTO_SEVERE_VERBOSITY) - cerr << "This warning occured at r= " << coor1[1] << endl - << "i.e. far from horizon --> to be investigated" - << ", or maybe increase parameter cstol" - << "in KerrBL.C" << endl; + GYOTO_SEVERE << "This warning occured at r= " << coor1[1] << endl + << "i.e. far from horizon --> to be investigated" + << ", or maybe increase parameter cstol" + << "in KerrBL.C" << endl; } } @@ -706,7 +782,10 @@ } // while loop end - + + //line -> checkPhiTheta(coordout1); + //for some reason the above line leads to infinite iteration with fixed star + return 0; } @@ -730,21 +809,28 @@ */ double argsqrt, limarg=1e-5, limargbis=0.1; - double costh=cos(mycoor[2]), sinth=sin(mycoor[2]), a2=spin_*spin_; + double costh, sinth, a2=spin_*spin_; + sincos(mycoor[2], &sinth, &costh); + double sinthm2=1./(sinth*sinth), costh2=costh*costh; double mu=cst[0], EE=cst[1], LL=cst[2], QQ=cst[3], QQm1=cst[4]; - double Sigma=mycoor[1]*mycoor[1]+a2*costh*costh; - double Qtest=Sigma*mycoor[6]*Sigma*mycoor[6]+costh*costh*(a2*(mu*mu-EE*EE)+LL*LL/(sinth*sinth));//this should be equal to constant QQ + double mu2=mu*mu, EE2=EE*EE, LL2=LL*LL; + double Sigma=mycoor[1]*mycoor[1]+a2*costh2; + double Sigma2=Sigma*Sigma; + double Qtest= + Sigma2*mycoor[6]*mycoor[6]+costh2*(a2*(mu2-EE2)+LL2*sinthm2); + //this should be equal to constant QQ int thdotpos=1; - if (debug()) - cerr << "DEBUG: KerrBL::CheckCons(): " - << "mu="<limargbis) throwError("In KerrBL::CheckCons Impossible to determine thetadot; " "maybe try to increase parameter limarg"); - if (debug()) cerr << "WARNING In KerrBL::CheckCons argsqrt= " << argsqrt << " at theta= " << coor_init[2] << ". Putting it to 0..." << endl; + GYOTO_INFO << "KerrBL::CheckCons argsqrt= " << argsqrt << " at theta= " << coor_init[2] << ". Putting it to 0..." << endl; argsqrt=0.; } } @@ -800,9 +886,9 @@ } if (argrac<0 && fabs(argrac)>arglim) { if (rr/rhor < 2.) {//A AFFINER?? //if the quantity is <0 and "big", but we are close to horizon --> put it to zero with Warning message - if (debug()) { - cerr << "WARNING 0-NORM CLOSE TO HORIZON : " - << "in KerrBL::Normalize4v impossible to normalize 0-mass " + if (verbose() >= GYOTO_WARNING_VERBOSITY) { + GYOTO_WARNING << "0-NORM CLOSE TO HORIZON : " + << "in KerrBL::Normalize4v impossible to normalize 0-mass " << "particule next to horizon. Putting argrac to 0. " << "Effective value of argrac= " << argrac << endl << "with coord= "; @@ -822,10 +908,15 @@ double argrac=-(1.+gtt*tdot*tdot+2.*gtph*phdot*tdot+gthth*thdot*thdot+gphph*phdot*phdot)/grr; double arglim=1e-7; + + GYOTO_DEBUG_ARRAY(coord, 8); + GYOTO_DEBUG_EXPR(argrac); + GYOTO_DEBUG_EXPR(rr/rhor); + if (argrac<0 && fabs(argrac)arglim) { if (rr/rhor < 2.) {//A AFFINER?? - if (debug()) { + if (verbose()>=GYOTO_WARNING_VERBOSITY) { cerr << "WARNING -1 - NORM CLOSE TO HORIZON : " << "in KerrBL::Normalize4v impossible to normalize massive " << "particle next to horizon. Putting argrac to 0. " @@ -851,39 +942,37 @@ void KerrBL::MakeCoord(const double coordin[8], const double cst[5], double coord[8]) const { - double tt=coordin[0], rr = coordin[1], theta=coordin[2], phi=coordin[3], pr=coordin[5], ptheta=coordin[6]; double r2 = rr*rr ; - double costheta2=cos(theta)*cos(theta), sintheta2=sin(theta)*sin(theta), + double sinth, costh; + sincos(theta, &sinth, &costh); + double costheta2=costh*costh, sintheta2=sinth*sinth, aa=spin_, a2=aa*aa; - double Sigma=r2+a2*costheta2, Delta=r2-2*rr+a2, lambda=1.-2*rr/Sigma, - xi=2.*aa*rr*sintheta2/Sigma, xi2=xi*xi, - gamma = sintheta2*(r2+a2+2.*a2*rr*sintheta2/Sigma), - fact=1./(gamma*lambda+xi2); + double Sigma=r2+a2*costheta2, Delta=r2-2*rr+a2, gtt=-(1.-2*rr/Sigma), + gtp=-2.*aa*rr*sintheta2/Sigma, + gpp = sintheta2*(r2+a2+2.*a2*rr*sintheta2/Sigma), + det=gtp*gtp-gtt*gpp, detm1=1./det; double EE=cst[1], LL=cst[2]; double rdot=Delta/Sigma*pr, thetadot=1./Sigma*ptheta, - phidot=lambda*fact*LL+xi*fact*EE, tdot=-xi*fact*LL+gamma*fact*EE; + phidot=-(gtt*LL+gtp*EE)*detm1, tdot=(gtp*LL+gpp*EE)*detm1; - coord[0]=tt;coord[1]=rr;coord[2]=theta;coord[3]=phi;coord[4]=tdot;coord[5]=rdot;coord[6]=thetadot;coord[7]=phidot; + coord[0]=tt;coord[1]=rr;coord[2]=theta;coord[3]=phi;coord[4]=tdot; + coord[5]=rdot;coord[6]=thetadot;coord[7]=phidot; } void KerrBL::MakeMomentum(const double coord[8], const double cst[5], double coordout[8]) const{ - double EE=cst[1], LL=cst[2]; - // double tt=coord[0], rr = coord[1], theta=coord[2], phi=coord[3], tdot=coord[4], - // rdot=coord[5], thetadot=coord[6], phidot=coord[7]; double tt=coord[0], rr = coord[1], theta=coord[2], phi=coord[3], rdot=coord[5], thetadot=coord[6]; - - double r2 = rr*rr, costheta2=cos(theta)*cos(theta); + double r2 = rr*rr, costheta2=cos(theta); costheta2*=costheta2; // sintheta2=sin(theta)*sin(theta); double aa=spin_, a2=aa*aa; @@ -892,7 +981,9 @@ double pr=Sigma/Delta*rdot, ptheta=Sigma*thetadot; - coordout[0]=tt;coordout[1]=rr;coordout[2]=theta;coordout[3]=phi;coordout[4]=-EE;coordout[5]=pr;coordout[6]=ptheta;coordout[7]=LL; + coordout[0]=tt;coordout[1]=rr;coordout[2]=theta; + coordout[3]=phi;coordout[4]=-EE;coordout[5]=pr; + coordout[6]=ptheta;coordout[7]=LL; } void KerrBL::nullifyCoord(double coord[8]) const { @@ -912,12 +1003,12 @@ c+=gmunu(coord, i, i)*coord[4+i]*coord[4+i]; } - double Delta=b*b-a*c; - tdot2=(-b+sqrt(Delta))/a; - coord[4]=(-b-sqrt(Delta))/a; + double sDelta=sqrt(b*b-a*c), am1=1./a; + tdot2=(-b+sDelta)*am1; + coord[4]=(-b-sDelta)*am1; } -void KerrBL::computeCst(const double coord[8], double cst[5]) const{ +void KerrBL::computeCst(const double coord[8], double cst[5]) const{ //double tt=coord[0], rr = coord[1], theta=coord[2], phi=coord[3], tdot=coord[4], // rdot=coord[5], thetadot=coord[6], phidot=coord[7]; @@ -926,13 +1017,16 @@ double norm=ScalarProd(coord, coord+4, coord+4); - double r2 = rr*rr, costheta2=cos(theta)*cos(theta), - sintheta2=sin(theta)*sin(theta); + double sinth, costh; + sincos(theta, &sinth, &costh); + double r2 = rr*rr, rm1=1./rr, costheta2=costh*costh, + sintheta2=sinth*sinth; - double aa=spin_, a2=aa*aa; - - double Sigma=r2+a2*costheta2, fact=2.*aa*rr*sintheta2/Sigma; + double a2=spin_*spin_; + double Sigma=r2+a2*costheta2, fact=2.*spin_*rr*sintheta2/Sigma; + //fact is -g_tphi + double mu;//Particule mass: 0 or 1 if (fabs(norm) KerrBL::Subcontractor(FactoryMessenger* fmp) { - - double spin=0., mass=1.; //default values - string name="", content=""; - - while (fmp->getNextParameter(&name, &content)) { - if(name=="Spin") spin=atof(content.c_str()); - } - SmartPointer gg = new KerrBL(spin, mass); - gg -> processGenericParameters(fmp); - return gg; +void KerrBL::setParameter(string name, string content, string unit) { + if(name=="Spin") setSpin(atof(content.c_str())); + else Generic::setParameter(name, content, unit); } -void Gyoto::Metric::KerrBL::Init() { - Gyoto::Metric::Register("KerrBL", &KerrBL::Subcontractor); -} #endif diff -Nru gyoto-0.0.3/lib/KerrKS.C gyoto-0.1.0/lib/KerrKS.C --- gyoto-0.0.3/lib/KerrKS.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/KerrKS.C 2013-07-27 09:14:20.000000000 +0000 @@ -73,7 +73,10 @@ */ // Mutators -void KerrKS::setSpin(const double spin) { spin_=spin; } +void KerrKS::setSpin(const double spin) { + spin_=spin; + tellListeners(); +} // Accessors double KerrKS::getSpin() const { return spin_ ; } @@ -245,7 +248,7 @@ double err; int count=0; - double newnorm; + // double newnorm; while (1){ count++; @@ -292,7 +295,7 @@ /* !!! Don't remove the line below !!!*/ /* Although it should be useless, removing it renders the Metric useless under Linux! Further investigation is needed...*/ - newnorm=ScalarProd(coord1, coord1+4, coord1+4); + // newnorm=ScalarProd(coord1, coord1+4, coord1+4); //This "norm check" is trash, it's of no use, except to slow down drastically the computation (even with it, the norm can be very bad) /*if (fabs(newnorm-normref) > factnorm*fabs(lastnorm-normref)) { @@ -398,7 +401,7 @@ double dir) const { double rcross=sqrt ( coor[1]*coor[1] + coor[2]*coor[2] - spin_*spin_); - double Omega=dir*sqrt(1./(rcross*rcross*rcross));//angular Keplerian velocity + double Omega=dir*pow(rcross*rcross*rcross, -0.5);//angular Keplerian velocity vel[1] = -coor[2]*Omega; vel[2] = coor[1]*Omega; @@ -498,27 +501,14 @@ return 0; } +void KerrKS::setParameter(string name, string content, string unit) { + if (name=="Spin") setSpin(atof(content.c_str())); + else Generic::setParameter(name, content, unit); +} + #ifdef GYOTO_USE_XERCES void KerrKS::fillElement(Gyoto::FactoryMessenger *fmp) { fmp -> setParameter("Spin", spin_); Metric::Generic::fillElement(fmp); } - -SmartPointer -Gyoto::Metric::KerrKS::Subcontractor(FactoryMessenger* fmp) { - - double spin=0., mass=1.; //default values - string name="", content=""; - - while (fmp->getNextParameter(&name, &content)) { - if(name=="Spin") spin=atof(content.c_str()); - } - SmartPointer gg = new KerrKS(spin, mass); - gg -> processGenericParameters(fmp); - return gg; -} - -void Gyoto::Metric::KerrKS::Init() { - Gyoto::Metric::Register("KerrKS", &Subcontractor); -} #endif diff -Nru gyoto-0.0.3/lib/LorenePlug.C gyoto-0.1.0/lib/LorenePlug.C --- gyoto-0.0.3/lib/LorenePlug.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/LorenePlug.C 2013-07-27 09:14:20.000000000 +0000 @@ -26,5 +26,7 @@ */ extern "C" void __GyotoloreneInit() { - Gyoto::Metric::RotStar3_1::Init(); + Gyoto::Metric::Register("RotStar3_1", + &(Gyoto::Metric::Subcontractor + )); } diff -Nru gyoto-0.0.3/lib/Makefile gyoto-0.1.0/lib/Makefile --- gyoto-0.0.3/lib/Makefile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -SHELL=/bin/sh -include ../local_settings - -.SUFFIXES : .o .C - -SRC = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ - Worldline.C FocalPlane.C Photon.C Scenery.C \ - WorldlineIntegState.C Error.C Screen.C Spectrum.C \ - Spectrometer.C ThinDisk.C - -STDPLUG_SRC = KerrBL.C KerrKS.C \ - Star.C FixedStar.C Torus.C \ - PowerLawSpectrum.C BlackBodySpectrum.C \ - ComplexAstrobj.C UniformSphere.C \ - StandardAstrobj.C PageThorneDisk.C \ - ThinDiskPL.C - -ifneq (,$(findstring -DGYOTO_USE_CFITSIO,$(GYOTO_FLAGS))) -STDPLUG_SRC += PatternDisk.C PatternDiskBB.C DynamicalDisk.C Disk3D.C \ - Disk3D_BB.C -endif - - -LORENEPLUG_SRC= RotStar3_1.C LorenePlug.C - -OBJ = $(SRC:.C=.o) -STDPLUG_OBJ = $(STDPLUG_SRC:.C=.o) -LORENEPLUG_OBJ = $(LORENEPLUG_SRC:.C=.o) - -PLUGINS = libgyoto-stdplug.$(DYLIB_SFX) - -ifdef HOME_LORENE -PLUGINS += libgyoto-lorene.$(DYLIB_SFX) -endif - -all: libgyoto.a $(LIBGYOTO_FILE) $(PLUGINS) - - -list_src: - echo $(SRC) - -.C.o: - $(CXX) -c $(GYOTO_FLAGS) -I../include $(CPPFLAGS) $(CXXFLAGS) $< - -libgyoto.a: $(OBJ) - rm -f $@ - $(STLIB_CMD) $@ $^ - -$(LIBGYOTO_FILE): $(OBJ) -ifeq ($(SYS),Linux) - ln -fs $(LIBGYOTO_FILE) libgyoto.so.$(SOVERS_MAJOR) - ln -fs $(LIBGYOTO_FILE) libgyoto.so -endif - $(CXX) -o $(LIBGYOTO_FILE) $(DYLIB_FLAG) $(LDFLAGS) $(LDLIBS) $^ - -libgyoto-stdplug.$(DYLIB_SFX): $(STDPLUG_OBJ) StdPlug.o $(LIBGYOTO_FILE) Metric.o - $(CXX) -o $@ $(PLUG_FLAGS) $(STDPLUG_OBJ) StdPlug.o $(LDFLAGS) $(LDLIBS) - -$(LORENEPLUG_OBJ): $(LORENEPLUG_SRC) - make -f Makefile.lorene $@ - -libgyoto-lorene.$(DYLIB_SFX): $(LORENEPLUG_OBJ) $(LIBGYOTO_FILE) - make -f Makefile.lorene - -doc: doc.C $(SRC) *.h - doxygen doxyfile - -clean: - rm -fr *.dSYM - rm -f $(OBJ) $(STDPLUG_OBJ) $(LORENEPLUG_OBJ) StdPlug.o *.$(DYLIB_SFX)* - rm -fr Doc - rm -fr *~ - rm -f libgyoto.a - rm -f ../include/*~ - rm -Rf Gyoto - -$(DESTDIR)$(PREFIX)/include/Gyoto $(DESTDIR)$(PREFIX)/lib \ - $(DESTDIR)$(PREFIX)/lib/gyoto/$(SOVERS): - install -d $@ - -install: libgyoto.a $(LIBGYOTO_FILE) $(PLUGINS) \ - $(DESTDIR)$(PREFIX)/include/Gyoto $(DESTDIR)$(PREFIX)/lib \ - $(DESTDIR)$(PREFIX)/lib/gyoto/$(SOVERS) - install -m 0755 $(LIBGYOTO_FILE) $(DESTDIR)$(PREFIX)/lib -ifeq ($(SYS),Linux) - ln -sf $(LIBGYOTO_FILE) $(DESTDIR)$(PREFIX)/lib/libgyoto.so.$(SOVERS_MAJOR) - ln -sf $(LIBGYOTO_FILE) $(DESTDIR)$(PREFIX)/lib/libgyoto.so -endif - install -m 0755 libgyoto-stdplug.$(DYLIB_SFX) $(DESTDIR)$(PREFIX)/lib/gyoto/$(SOVERS) - -install -m 0755 libgyoto-lorene.$(DYLIB_SFX) $(DESTDIR)$(PREFIX)/lib/gyoto/$(SOVERS) - install -m 0644 libgyoto.a $(DESTDIR)$(PREFIX)/lib - install -m 0644 ../include/Gyoto*.h $(DESTDIR)$(PREFIX)/include/Gyoto - -uninstall: - rm -f $(DESTDIR)$(PREFIX)/lib/libgyoto* - rm -f $(DESTDIR)$(PREFIX)/include/Gyoto*.h - -.PHONY: clean install uninstall diff -Nru gyoto-0.0.3/lib/Makefile.am gyoto-0.1.0/lib/Makefile.am --- gyoto-0.0.3/lib/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/Makefile.am 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,51 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_CPPFLAGS = -I@top_srcdir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) +AM_LDFLAGS = $(XERCESLDFLAGS) -export-dynamic $(PTHREAD_LIBS) \ + $(UDUNITS_LDFLAGS) +AM_CXXFLAGS = $(PTHREAD_CFLAGS) -DGYOTO_PREFIX=\"${prefix}\" + +# HEADERS: where they are, where to install them +library_includedir=$(includedir)/Gyoto +library_include_HEADERS=$(top_srcdir)/include/*.h + +# MAIN LIBRARY +lib_LTLIBRARIES = libgyoto.la +libgyoto_la_SOURCES = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ + Worldline.C Photon.C Scenery.C \ + WorldlineIntegState.C Error.C Screen.C Spectrum.C \ + Spectrometer.C ComplexSpectrometer.C UniformSpectrometer.C \ + ThinDisk.C Converters.C Functors.C Hooks.C +libgyoto_la_LIBS = $(XERCESLDFLAGS) +libgyoto_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSINFO) + +# STANDARD PLUGIN +soverdir=$(pkglibdir)/@sovers@ +sover_LTLIBRARIES = libgyoto-stdplug.la +libgyoto_stdplug_la_SOURCES = KerrBL.C KerrKS.C \ + Star.C FixedStar.C Torus.C \ + PowerLawSpectrum.C BlackBodySpectrum.C \ + ComplexAstrobj.C UniformSphere.C \ + StandardAstrobj.C PageThorneDisk.C \ + ThinDiskPL.C PolishDoughnut.C \ + StdPlug.C +# those files are used only if cfitsio is available +cfitsio_stdplug_sources = PatternDisk.C PatternDiskBB.C DynamicalDisk.C \ + Disk3D.C Disk3D_BB.C +EXTRA_libgyoto_stdplug_la_SOURCES = $(cfitsio_stdplug_sources) +if HAVE_CFITSIO +libgyoto_stdplug_la_SOURCES += $(cfitsio_stdplug_sources) +endif +libgyoto_stdplug_la_LDFLAGS = -module -export-dynamic $(CFITSIOLDFLAGS) \ + $(AM_LDFLAGS) + +# LORENE PLUGIN +if HAVE_LORENE +sover_LTLIBRARIES += libgyoto-lorene.la +endif +libgyoto_lorene_la_SOURCES = RotStar3_1.C LorenePlug.C +libgyoto_lorene_la_LDFLAGS = -module -export-dynamic $(LORENELDFLAGS) $(AM_LDFLAGS) +libgyoto_lorene_la_CPPFLAGS = $(AM_CPPFLAGS) $(LORENECPPFLAGS) + +# pkg-config file +pkgconfigdir=$(libdir)/pkgconfig +pkgconfig_DATA=gyoto.pc diff -Nru gyoto-0.0.3/lib/Makefile.in gyoto-0.1.0/lib/Makefile.in --- gyoto-0.0.3/lib/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/Makefile.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,836 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@HAVE_CFITSIO_TRUE@am__append_1 = $(cfitsio_stdplug_sources) + +# LORENE PLUGIN +@HAVE_LORENE_TRUE@am__append_2 = libgyoto-lorene.la +subdir = lib +DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/gyoto-uninstalled.pc.in \ + $(srcdir)/gyoto.pc.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/include/GyotoConfig.h +CONFIG_CLEAN_FILES = gyoto.pc gyoto-uninstalled.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soverdir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(library_includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(sover_LTLIBRARIES) +libgyoto_lorene_la_LIBADD = +am_libgyoto_lorene_la_OBJECTS = libgyoto_lorene_la-RotStar3_1.lo \ + libgyoto_lorene_la-LorenePlug.lo +libgyoto_lorene_la_OBJECTS = $(am_libgyoto_lorene_la_OBJECTS) +libgyoto_lorene_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libgyoto_lorene_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_LORENE_TRUE@am_libgyoto_lorene_la_rpath = -rpath $(soverdir) +libgyoto_stdplug_la_LIBADD = +am__libgyoto_stdplug_la_SOURCES_DIST = KerrBL.C KerrKS.C Star.C \ + FixedStar.C Torus.C PowerLawSpectrum.C BlackBodySpectrum.C \ + ComplexAstrobj.C UniformSphere.C StandardAstrobj.C \ + PageThorneDisk.C ThinDiskPL.C PolishDoughnut.C StdPlug.C \ + PatternDisk.C PatternDiskBB.C DynamicalDisk.C Disk3D.C \ + Disk3D_BB.C +am__objects_1 = PatternDisk.lo PatternDiskBB.lo DynamicalDisk.lo \ + Disk3D.lo Disk3D_BB.lo +@HAVE_CFITSIO_TRUE@am__objects_2 = $(am__objects_1) +am_libgyoto_stdplug_la_OBJECTS = KerrBL.lo KerrKS.lo Star.lo \ + FixedStar.lo Torus.lo PowerLawSpectrum.lo BlackBodySpectrum.lo \ + ComplexAstrobj.lo UniformSphere.lo StandardAstrobj.lo \ + PageThorneDisk.lo ThinDiskPL.lo PolishDoughnut.lo StdPlug.lo \ + $(am__objects_2) +libgyoto_stdplug_la_OBJECTS = $(am_libgyoto_stdplug_la_OBJECTS) +libgyoto_stdplug_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libgyoto_stdplug_la_LDFLAGS) $(LDFLAGS) -o $@ +libgyoto_la_LIBADD = +am_libgyoto_la_OBJECTS = Astrobj.lo Factory.lo Register.lo \ + SmartPointer.lo Utils.lo Metric.lo Worldline.lo Photon.lo \ + Scenery.lo WorldlineIntegState.lo Error.lo Screen.lo \ + Spectrum.lo Spectrometer.lo ComplexSpectrometer.lo \ + UniformSpectrometer.lo ThinDisk.lo Converters.lo Functors.lo \ + Hooks.lo +libgyoto_la_OBJECTS = $(am_libgyoto_la_OBJECTS) +libgyoto_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libgyoto_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libgyoto_lorene_la_SOURCES) $(libgyoto_stdplug_la_SOURCES) \ + $(EXTRA_libgyoto_stdplug_la_SOURCES) $(libgyoto_la_SOURCES) +DIST_SOURCES = $(libgyoto_lorene_la_SOURCES) \ + $(am__libgyoto_stdplug_la_SOURCES_DIST) \ + $(EXTRA_libgyoto_stdplug_la_SOURCES) $(libgyoto_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(pkgconfig_DATA) +HEADERS = $(library_include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFITSIOCPPFLAGS = @CFITSIOCPPFLAGS@ +CFITSIOLDFLAGS = @CFITSIOLDFLAGS@ +CFITSIO_CFLAGS = @CFITSIO_CFLAGS@ +CFITSIO_LIBS = @CFITSIO_LIBS@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DYLIB_VAR = @DYLIB_VAR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HOME_LORENE = @HOME_LORENE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LORENECPPFLAGS = @LORENECPPFLAGS@ +LORENELDFLAGS = @LORENELDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_S = @MAKE_S@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POW_LIB = @POW_LIB@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYS = @SYS@ +UDUNITS_CFLAGS = @UDUNITS_CFLAGS@ +UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@ +UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@ +UDUNITS_LIBS = @UDUNITS_LIBS@ +VERSINFO = @VERSINFO@ +VERSION = @VERSION@ +XERCESCPPFLAGS = @XERCESCPPFLAGS@ +XERCESLDFLAGS = @XERCESLDFLAGS@ +XERCES_CFLAGS = @XERCES_CFLAGS@ +XERCES_LIBS = @XERCES_LIBS@ +YORICK = @YORICK@ +Y_INST_HOME = @Y_INST_HOME@ +Y_INST_SITE = @Y_INST_SITE@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +mySUBDIRS = @mySUBDIRS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkg_cflags = @pkg_cflags@ +pkg_libs = @pkg_libs@ +pkg_requires = @pkg_requires@ +plugin_sfx = @plugin_sfx@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sovers = @sovers@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 +AM_CPPFLAGS = -I@top_srcdir@/include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) +AM_LDFLAGS = $(XERCESLDFLAGS) -export-dynamic $(PTHREAD_LIBS) \ + $(UDUNITS_LDFLAGS) + +AM_CXXFLAGS = $(PTHREAD_CFLAGS) -DGYOTO_PREFIX=\"${prefix}\" + +# HEADERS: where they are, where to install them +library_includedir = $(includedir)/Gyoto +library_include_HEADERS = $(top_srcdir)/include/*.h + +# MAIN LIBRARY +lib_LTLIBRARIES = libgyoto.la +libgyoto_la_SOURCES = Astrobj.C Factory.C Register.C SmartPointer.C Utils.C Metric.C \ + Worldline.C Photon.C Scenery.C \ + WorldlineIntegState.C Error.C Screen.C Spectrum.C \ + Spectrometer.C ComplexSpectrometer.C UniformSpectrometer.C \ + ThinDisk.C Converters.C Functors.C Hooks.C + +libgyoto_la_LIBS = $(XERCESLDFLAGS) +libgyoto_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSINFO) + +# STANDARD PLUGIN +soverdir = $(pkglibdir)/@sovers@ +sover_LTLIBRARIES = libgyoto-stdplug.la $(am__append_2) +libgyoto_stdplug_la_SOURCES = KerrBL.C KerrKS.C Star.C FixedStar.C \ + Torus.C PowerLawSpectrum.C BlackBodySpectrum.C \ + ComplexAstrobj.C UniformSphere.C StandardAstrobj.C \ + PageThorneDisk.C ThinDiskPL.C PolishDoughnut.C StdPlug.C \ + $(am__append_1) +# those files are used only if cfitsio is available +cfitsio_stdplug_sources = PatternDisk.C PatternDiskBB.C DynamicalDisk.C \ + Disk3D.C Disk3D_BB.C + +EXTRA_libgyoto_stdplug_la_SOURCES = $(cfitsio_stdplug_sources) +libgyoto_stdplug_la_LDFLAGS = -module -export-dynamic $(CFITSIOLDFLAGS) \ + $(AM_LDFLAGS) + +libgyoto_lorene_la_SOURCES = RotStar3_1.C LorenePlug.C +libgyoto_lorene_la_LDFLAGS = -module -export-dynamic $(LORENELDFLAGS) $(AM_LDFLAGS) +libgyoto_lorene_la_CPPFLAGS = $(AM_CPPFLAGS) $(LORENECPPFLAGS) + +# pkg-config file +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = gyoto.pc +all: all-am + +.SUFFIXES: +.SUFFIXES: .C .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +gyoto.pc: $(top_builddir)/config.status $(srcdir)/gyoto.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +gyoto-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/gyoto-uninstalled.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-soverLTLIBRARIES: $(sover_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(sover_LTLIBRARIES)'; test -n "$(soverdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(soverdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(soverdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(soverdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(soverdir)"; \ + } + +uninstall-soverLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(sover_LTLIBRARIES)'; test -n "$(soverdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(soverdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(soverdir)/$$f"; \ + done + +clean-soverLTLIBRARIES: + -test -z "$(sover_LTLIBRARIES)" || rm -f $(sover_LTLIBRARIES) + @list='$(sover_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libgyoto-lorene.la: $(libgyoto_lorene_la_OBJECTS) $(libgyoto_lorene_la_DEPENDENCIES) $(EXTRA_libgyoto_lorene_la_DEPENDENCIES) + $(libgyoto_lorene_la_LINK) $(am_libgyoto_lorene_la_rpath) $(libgyoto_lorene_la_OBJECTS) $(libgyoto_lorene_la_LIBADD) $(LIBS) +libgyoto-stdplug.la: $(libgyoto_stdplug_la_OBJECTS) $(libgyoto_stdplug_la_DEPENDENCIES) $(EXTRA_libgyoto_stdplug_la_DEPENDENCIES) + $(libgyoto_stdplug_la_LINK) -rpath $(soverdir) $(libgyoto_stdplug_la_OBJECTS) $(libgyoto_stdplug_la_LIBADD) $(LIBS) +libgyoto.la: $(libgyoto_la_OBJECTS) $(libgyoto_la_DEPENDENCIES) $(EXTRA_libgyoto_la_DEPENDENCIES) + $(libgyoto_la_LINK) -rpath $(libdir) $(libgyoto_la_OBJECTS) $(libgyoto_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Astrobj.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BlackBodySpectrum.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ComplexAstrobj.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ComplexSpectrometer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Converters.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Disk3D.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Disk3D_BB.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynamicalDisk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Error.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Factory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FixedStar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Functors.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Hooks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KerrBL.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KerrKS.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Metric.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PageThorneDisk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PatternDisk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PatternDiskBB.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Photon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PolishDoughnut.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PowerLawSpectrum.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Register.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Scenery.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Screen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SmartPointer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Spectrometer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Spectrum.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StandardAstrobj.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Star.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StdPlug.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ThinDisk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ThinDiskPL.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Torus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniformSpectrometer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniformSphere.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Worldline.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WorldlineIntegState.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgyoto_lorene_la-LorenePlug.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Plo@am__quote@ + +.C.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.C.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.C.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libgyoto_lorene_la-RotStar3_1.lo: RotStar3_1.C +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgyoto_lorene_la-RotStar3_1.lo -MD -MP -MF $(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Tpo -c -o libgyoto_lorene_la-RotStar3_1.lo `test -f 'RotStar3_1.C' || echo '$(srcdir)/'`RotStar3_1.C +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Tpo $(DEPDIR)/libgyoto_lorene_la-RotStar3_1.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RotStar3_1.C' object='libgyoto_lorene_la-RotStar3_1.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgyoto_lorene_la-RotStar3_1.lo `test -f 'RotStar3_1.C' || echo '$(srcdir)/'`RotStar3_1.C + +libgyoto_lorene_la-LorenePlug.lo: LorenePlug.C +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgyoto_lorene_la-LorenePlug.lo -MD -MP -MF $(DEPDIR)/libgyoto_lorene_la-LorenePlug.Tpo -c -o libgyoto_lorene_la-LorenePlug.lo `test -f 'LorenePlug.C' || echo '$(srcdir)/'`LorenePlug.C +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libgyoto_lorene_la-LorenePlug.Tpo $(DEPDIR)/libgyoto_lorene_la-LorenePlug.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LorenePlug.C' object='libgyoto_lorene_la-LorenePlug.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgyoto_lorene_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgyoto_lorene_la-LorenePlug.lo `test -f 'LorenePlug.C' || echo '$(srcdir)/'`LorenePlug.C + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-library_includeHEADERS: $(library_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(library_includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(library_includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(library_includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(library_includedir)" || exit $$?; \ + done + +uninstall-library_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(library_includedir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(soverdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(library_includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-soverLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-library_includeHEADERS install-pkgconfigDATA \ + install-soverLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-library_includeHEADERS uninstall-pkgconfigDATA \ + uninstall-soverLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-soverLTLIBRARIES \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES \ + install-library_includeHEADERS install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-soverLTLIBRARIES install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-library_includeHEADERS uninstall-pkgconfigDATA \ + uninstall-soverLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru gyoto-0.0.3/lib/Makefile.lorene gyoto-0.1.0/lib/Makefile.lorene --- gyoto-0.0.3/lib/Makefile.lorene 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Makefile.lorene 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -SHELL=/bin/sh -include ../local_settings - -# Options for using Lorene: -# ------------------------- -# LORENE is used for numerically-computed metrics. -# It is not used e.g. for the Kerr metric. -# -# To link with LORENE, simply set HOME_LORENE in your environment. -# You shouldn't need to change anything below but who knows? -GYOTO_FLAGS += -DGYOTO_USE_LORENE -GYOTO_CXX:=$(CXX) -include $(HOME_LORENE)/local_settings -CXX=$(GYOTO_CXX) -LORENE_INC = -I$(HOME_LORENE)/C++/Include -LORENE_LIB_G = -L$(HOME_LORENE)/Lib -llorene_g -llorenef77_g \ - $(LIB_LAPACK) $(LIB_GSL) $(LIB_PGPLOT) -LORENE_LIBLOR = $(HOME_LORENE)/Lib/liblorene_g.a \ - $(HOME_LORENE)/Lib/liblorenef77_g.a \ - $(LIB_LAPACK) $(LIB_GSL) $(LIB_PGPLOT) \ - $(LIB_LORENE) -LIB_CXX += $(LORENE_LIB_G) - -LORENEPLUG_SRC= RotStar3_1.C LorenePlug.C -LORENEPLUG_OBJ = $(LORENEPLUG_SRC:.C=.o) - -all: libgyoto-lorene.$(DYLIB_SFX) - -libgyoto-lorene.$(DYLIB_SFX): $(LORENEPLUG_OBJ) - $(CXX) -o $@ $(PLUG_FLAGS) $(LORENEPLUG_OBJ) $(LDFLAGS) $(LDLIBS) - -.C.o: - $(CXX) -c $(GYOTO_FLAGS) -I../include $(LORENE_INC) $(CPPFLAGS) $(CXXFLAGS) $< - -.PHONY: all \ No newline at end of file diff -Nru gyoto-0.0.3/lib/Metric.C gyoto-0.1.0/lib/Metric.C --- gyoto-0.0.3/lib/Metric.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Metric.C 2013-07-27 09:14:20.000000000 +0000 @@ -22,6 +22,7 @@ #include #include "GyotoMetric.h" #include "GyotoFactoryMessenger.h" +#include "GyotoConverters.h" #include #include #include @@ -35,24 +36,30 @@ Metric::Generic::Generic() : mass_(1.), coordkind_(GYOTO_COORDKIND_UNSPECIFIED) { - if (debug()) cout << "Metric Construction" << endl ; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif setKind("Unspecified"); } Metric::Generic::Generic(const double mass, const int coordkind) : mass_(mass), coordkind_(coordkind) { - if (debug()) - cerr << "Metric Construction with mass="<=0) { - stringstream ss; - ss << "In Metric.C: Impossible condition (v>c): tdot^2="<< -1/sum - << " at pos=["<c\n"; + return 0.; } - return sqrt(-1./sum); + return pow(-sum, -0.5); } @@ -137,58 +142,28 @@ } void Metric::Generic::nullifyCoord(double coord[8], double& tdot2) const { - //int width=25;//15; - //int prec=15;//8; - //cout << "DNAS NUllIFY" << endl; - - // if (debug()) cout << "dans Metric::Generic::nullifyCoord coord au debut: " << coord[0] << " " << coord[1] << " " << coord[2] << " " << coord[3] << " " << coord[4] << " " << coord[5] << " " << coord[6] << " " << coord[7] << " " << endl; - int i, j; double a, b=0., c=0.; a=gmunu(coord, 0, 0); - //cout << "gtt = " << gmunu(coord, 0, 0) << endl; - //cout << "coord' dans nullify:" << endl; - //for (int myi=4;myi<8;myi++) cout << coord[myi] << " "; - //cout << endl; for (i=1;i<=3;++i) { b+=gmunu(coord, 0, i)*coord[4+i]; - //cout << "i g0i= " << i << " " << gmunu(coord, 0, i) << endl; for (j=1;j<=3;++j) { - //cout << "add to c: " << gmunu(coord, i, j)*coord[4+i]*coord[4+j] << endl; - //cout << "i j gij= " << i << " " << j << " " << gmunu(coord, i, j) << endl; c+=gmunu(coord, i, j)*coord[4+i]*coord[4+j]; } } - //cout << "a b c in Metric::Generic::nullify= " << a << " " << b << " " << c << endl; - // a*tdot*tdot + 2*b*tdot + c ==0. - double Delta=b*b-a*c; - tdot2=(-b+sqrt(Delta))/a; - // cout << "Delta a b c= " << setprecision(prec) << setw(width) << Delta << " " << setprecision(prec) << setw(width) << a << " " << setprecision(prec) << setw(width) << b << " " << setprecision(prec) << setw(width) << c << endl; - coord[4]=(-b-sqrt(Delta))/a; - // cout << "Tdot= " << coord[4] << endl; - /* - A creuser : en un point x0,x1,x2,x3 je spécifie la 3vitesse. Il existe deux géodésiques vérifiant ces conditions : celle qui pointe vers le futur (x0dot > 0) et celle qui pointe vers le passé (x0dot < 0). - La solution (-b-sqrt(Delta))/a semble être tjrs positive. C'est celle qu'on veut. - - */ + double sDelta=sqrt(b*b-a*c), am1=1./a; + tdot2=(-b+sDelta)*am1; + coord[4]=(-b-sDelta)*am1; } double Metric::Generic::ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const { - // cout << "a comparer a = " << gmunu(pos,0,0) << " " << gmunu(pos,2,2) << endl; double res=0.; for (int i=0;i<4;i++) { for (int j=0;j<4;j++) { - res+=gmunu(pos, i, j)*u1[i]*u2[j]; - //cout << "dans ScalarP: " << i << " " << j << " " << gmunu(pos, i, j) << " " << u1[i] << " " << u2[j] << " " << gmunu(pos, i, j)*u1[i]*u2[j] << endl; - } } - - /*for (int kk=0;kk<4;kk++) cout << "Metric: In Scalar: " << setprecision(10) << gmunu(pos, kk, kk) << " " << u1[kk] << " " << u2[kk] << endl; - cout << "** pour comp!" << gmunu(pos, 0, 0)*u1[0]*u2[0]+gmunu(pos, 1, 1)*u1[1]*u2[1]+gmunu(pos, 2, 2)*u1[2]*u2[2]+gmunu(pos, 3, 3)*u1[3]*u2[3] << endl;*/ - return res; } @@ -197,9 +172,7 @@ double res=0.; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { - res+=gmunu(pos,i+1, j+1)*pos[i]*pos[j]; - // if (debug()) cout << "i,j,res= " << i << " " << j << " " << res << endl; } } return sqrt(res); @@ -214,7 +187,9 @@ The general equation of geodesics is used. */ int Metric::Generic::diff(const double coord[8], double res[8]) const{ - if (debug()) cerr << "DEBUG: Metric::Generic::diff()" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif res[0]=coord[4]; res[1]=coord[5]; res[2]=coord[6]; @@ -416,12 +391,18 @@ return mass_ * GYOTO_G_OVER_C_SQUARE; } +double Metric::Generic::unitLength(const string &unit) const { + return Units::FromMeters(unitLength(), unit); +} + int Metric::Generic::isStopCondition(double const * const ) const { return 0; } void Metric::Generic::setParticleProperties(Worldline*, const double*) const { - if (debug()) cerr << "DEBUG: Metric::Generic::setParticleProperties() called, noop"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } @@ -436,7 +417,19 @@ fmp -> setParameter("Mass", getMass()); } +void Metric::Generic::setParameter(string name, string content, string unit) { + if(name=="Mass") setMass(atof(content.c_str()), unit); +} + +void Metric::Generic::setParameters(Gyoto::FactoryMessenger *fmp) { + string name="", content="", unit=""; + if (fmp) + while (fmp->getNextParameter(&name, &content, &unit)) + setParameter(name, content, unit); +} + void Metric::Generic::processGenericParameters(Gyoto::FactoryMessenger *fmp) { + if (!fmp) return; string name="", content=""; fmp -> reset(); while (fmp->getNextParameter(&name, &content)) { @@ -458,10 +451,11 @@ Gyoto::Metric::Register_ = ne; } -Metric::Subcontractor_t* Metric::getSubcontractor(std::string name) { +Metric::Subcontractor_t* +Metric::getSubcontractor(std::string name, int errmode) { if (!Gyoto::Metric::Register_) throwError("No Metric kind registered!"); return (Metric::Subcontractor_t*)Gyoto::Metric::Register_ - -> getSubcontractor(name); + -> getSubcontractor(name, errmode); } #endif diff -Nru gyoto-0.0.3/lib/PageThorneDisk.C gyoto-0.1.0/lib/PageThorneDisk.C --- gyoto-0.0.3/lib/PageThorneDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/PageThorneDisk.C 2013-07-27 09:14:20.000000000 +0000 @@ -34,6 +34,8 @@ #include #include #include +#include +#include using namespace std; using namespace Gyoto; @@ -41,26 +43,31 @@ PageThorneDisk::PageThorneDisk() : ThinDisk("PageThorneDisk"), aa_(0.), aa2_(0.), - x0_(0.), x1_(0.), x2_(0.), x3_(0.) + x0_(0.), x1_(0.), x2_(0.), x3_(0.), rednoise_(0), + uniflux_(0) { if (debug()) cerr << "DEBUG: PageThorneDisk Construction" << endl; } PageThorneDisk::PageThorneDisk(const PageThorneDisk& o) : ThinDisk(o), aa_(o.aa_), aa2_(o.aa2_), - x0_(o.x0_), x1_(o.x1_), x2_(o.x2_), x3_(o.x3_) + x0_(o.x0_), x1_(o.x1_), x2_(o.x2_), x3_(o.x3_), + rednoise_(o.rednoise_), uniflux_(o.uniflux_) { if (o.gg_()) gg_=o.gg_->clone(); Generic::gg_=gg_; + gg_->hook(this); } PageThorneDisk* PageThorneDisk::clone() const { return new PageThorneDisk(*this); } PageThorneDisk::~PageThorneDisk() { - if (debug()) cerr << "DEBUG: PageThorneDisk Destruction" << endl; + GYOTO_DEBUG<unhook(this); } void PageThorneDisk::updateSpin() { + if (!gg_) return; switch (gg_->getCoordKind()) { case GYOTO_COORDKIND_SPHERICAL: aa_ = static_cast >(gg_) -> getSpin(); @@ -85,18 +92,33 @@ } void PageThorneDisk::setMetric(SmartPointer gg) { + if (gg_) gg_->unhook(this); string kind = gg->getKind(); - if (kind != "KerrBL" && kind != "KerrKS") + if (kind != "KerrBL" && kind != "KerrKS" && kind != "ChernSimons") throwError ("PageThorneDisk::setMetric(): metric must be KerrBL or KerrKS"); ThinDisk::setMetric(gg); updateSpin(); + gg->hook(this); } -double PageThorneDisk::emission(double, double dsem, +double PageThorneDisk::emission(double nu_em, double dsem, double *, double coord_obj[8]) const{ + throwError("not implemented"); +} + +Quantity_t PageThorneDisk::getDefaultQuantities() { + return GYOTO_QUANTITY_USER4; +} + +double PageThorneDisk::bolometricEmission(double dsem, + double coord_obj[8]) const{ //See Page & Thorne 74 Eqs. 11b, 14, 15. This is F(r). + // Important remark: this emision function gives I(r), + // not I_nu(r). And I(r)/nu^4 is conserved. + // cout << "r hit= " << coord_obj[1] << endl; + if (uniflux_) return 1; double xx; switch (gg_->getCoordKind()) { @@ -106,23 +128,144 @@ case GYOTO_COORDKIND_CARTESIAN: xx=pow(coord_obj[1]*coord_obj[1]+coord_obj[2]*coord_obj[2]-aa2_, 0.25); break; + default: + throwError("Unknown coordinate system kind"); + xx=0; } + + // the above formula assume M=1 (x=sqrt(r/M)=sqrt(r)) + double x2=xx*xx; + double ff= 3./(2.)*1./(xx*xx*(xx*xx*xx-3.*xx+2.*aa_)) - *( xx-x0_-3./2.*aa_*log(xx/x0_) - -3.*(x1_-aa_)*(x1_-aa_)/(x1_*(x1_-x2_)*(x1_-x3_))*log((xx-x1_)/(x0_-x1_)) - -3.*(x2_-aa_)*(x2_-aa_)/(x2_*(x2_-x1_)*(x2_-x3_))*log((xx-x2_)/(x0_-x2_)) - -3.*(x3_-aa_)*(x3_-aa_)/(x3_*(x3_-x1_)*(x3_-x2_))*log((xx-x3_)/(x0_-x3_))); - // f of Page&Thorne - - double Iem=ff/((4.*M_PI)*(xx*xx)); //with Mdot=1 - Iem*=M_PI;//assume isotropic emission --> flux is then equal to - //"pi * specific intensity" (cf Ribicki Lightman) - + *( + xx-x0_-3./2.*aa_*log(xx/x0_) + -3.*(x1_-aa_)*(x1_-aa_)/(x1_*(x1_-x2_)*(x1_-x3_))*log((xx-x1_) + /(x0_-x1_)) + -3.*(x2_-aa_)*(x2_-aa_)/(x2_*(x2_-x1_)*(x2_-x3_))*log((xx-x2_) + /(x0_-x2_)) + -3.*(x3_-aa_)*(x3_-aa_)/(x3_*(x3_-x1_)*(x3_-x2_))*log((xx-x3_) + /(x0_-x3_)) + ); + // f of Page&Thorne, in units M=1 + + double Iem=ff/(4.*M_PI*M_PI*x2); + /* + with Mdot=1 (NB: Mdot is a constant) + Assuming isotropic emission: + flux at r = (I at r)* \int cos\theta dOmega = pi*I + thus intensity is only: 1/pi * flux + NB: this is frequency integrated (bolometric) intensity, not I_nu + NBB: the cgs value of I is c^6/G^2*Mdot/M^2 * Iem, it can be + recovered from the dimensionless Iem a posteriori if needed + */ + if (flag_radtransf_) Iem *= dsem; - + GYOTO_DEBUG_EXPR(Iem); + + if (rednoise_) { + double rr=coord_obj[1], + r32 = pow(rr,1.5), + tt=coord_obj[0], + cst_aa=0.1*sqrt(6), // amplitude cst + cst_tt=1.; // period cst + srand (time(NULL)); + double random = double(rand() % 100)/100. ; + Iem*=1.+cst_aa*random*pow(rr,-0.5)*sin(cst_tt*1./r32*tt); + if (Iem < 0.) throwError("In PageThorneDisk::bolometricEmission" + " rednoised emission is negative!"); + } + return Iem; + +} + +void PageThorneDisk::processHitQuantities(Photon* ph, double* coord_ph_hit, + double* coord_obj_hit, double dt, + Properties* data) const { +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif + /* + NB: freqObs is the observer's frequency chosen in + Screen::getRayCoord for the actual computation of the geodesic ; + the physical value of nuobs will be used in spectrum + computations by resorting to the xml specifications of the user + (see below) ; this freqObs is used to transform the null + worldline parameter dlambda (see below) + */ + double freqObs=ph->getFreqObs(); // this is a useless quantity, always 1 + double dlambda = dt/coord_ph_hit[4]; //dlambda = dt/tdot + double ggredm1 = -gg_->ScalarProd(coord_ph_hit,coord_obj_hit+4, + coord_ph_hit+4);// / 1.; + //this is nu_em/nu_obs + double ggred = 1./ggredm1; //this is nu_obs/nu_em + if (uniflux_) ggred=1.; + double dsem = dlambda*ggredm1; // *1. + double inc =0.; + if (data) { +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "data requested. " + << ", ggredm1=" << ggredm1 + << ", ggred=" << ggred + << endl; +#endif + + if (data->redshift) { + *data->redshift=ggred; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(*data->redshift); +#endif + } + if (data->time) { + *data->time=coord_ph_hit[0]; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(*data->time); +#endif + } + if (data->impactcoords) { + memcpy(data->impactcoords, coord_obj_hit, 8 * sizeof(double)); + memcpy(data->impactcoords+8, coord_ph_hit, 8 * sizeof(double)); + } +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "dlambda = (dt="<< dt << ")/(tdot="<< coord_ph_hit[4] + << ") = " << dlambda << ", dsem=" << dsem << endl; +#endif + if (data->intensity) throwError("unimplemented"); + else if (data->user4) { + inc = (bolometricEmission(dsem, coord_obj_hit)) + * (ph -> getTransmission(size_t(-1))) + * ggred*ggred*ggred*ggred; // I/nu^4 invariant + *data->user4 += inc; +#if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(*data->user4); +#endif + + } + if (data->binspectrum) throwError("unimplemented"); + if (data->spectrum) throwError("unimplemented"); + /* update photon's transmission */ + ph -> transmit(size_t(-1), + transmission(freqObs*ggredm1, dsem,coord_ph_hit)); + } else { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "NO data requested!" << endl; +# endif + } +} + +void PageThorneDisk::tell(Hook::Teller* msg) { + updateSpin(); +} +int PageThorneDisk::setParameter(std::string name, + std::string content, + std::string unit) { + char* tc = const_cast(content.c_str()); + if (name=="RedNoise") rednoise_=1; + if (name=="UniFlux") uniflux_=1; + else return ThinDisk::setParameter(name, content, unit); + return 0; } #ifdef GYOTO_USE_XERCES diff -Nru gyoto-0.0.3/lib/PatternDisk.C gyoto-0.1.0/lib/PatternDisk.C --- gyoto-0.0.3/lib/PatternDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/PatternDisk.C 2013-07-27 09:14:20.000000000 +0000 @@ -130,10 +130,10 @@ throwError( "dimensions can't be null"); if (nr_==1 || nphi_==1) throwError("In PatternDisk::copyIntensity: dimensions should be >1"); - dr_ = (rout_ - rin_) / double(nr_-1.); + dr_ = (rout_ - rin_) / double(nr_-1); if (repeat_phi_==0.) throwError("In PatternDisk::copyIntensity: repeat_phi is 0!"); - dphi_ = (phimax_-phimin_)/double((nphi_-1.)*repeat_phi_); + dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); GYOTO_DEBUG << "allocate emission_;" << endl; emission_ = new double[nel]; GYOTO_DEBUG << "pattern >> emission_" << endl; @@ -141,7 +141,7 @@ } } -double const * const PatternDisk::getIntensity() const { return emission_; } +double const * PatternDisk::getIntensity() const { return emission_; } void PatternDisk::getIntensityNaxes( size_t naxes[3] ) const { naxes[0] = nnu_; naxes[1] = nphi_; naxes[2] = nr_; } @@ -164,7 +164,7 @@ } } -double const * const PatternDisk::getOpacity() const { return opacity_; } +double const * PatternDisk::getOpacity() const { return opacity_; } void PatternDisk::copyVelocity(double const *const velocity, size_t const naxes[2]) { GYOTO_DEBUG << endl; @@ -182,7 +182,7 @@ memcpy(velocity_, velocity, 2*nphi_*nr_*sizeof(double)); } } -double const * const PatternDisk::getVelocity() const { return velocity_; } +double const * PatternDisk::getVelocity() const { return velocity_; } void PatternDisk::copyGridRadius(double const *const radius, size_t nr) { GYOTO_DEBUG << endl; @@ -202,12 +202,12 @@ rout_=radius_[nr_-1]; } } -double const * const PatternDisk::getGridRadius() const { return radius_; } +double const * PatternDisk::getGridRadius() const { return radius_; } void PatternDisk::repeatPhi(size_t n) { repeat_phi_ = n; - if ((nphi_-1.)*repeat_phi_>0) - dphi_=(phimax_-phimin_)/double((nphi_-1.)*repeat_phi_); + if ((nphi_-1)*repeat_phi_>0) + dphi_=(phimax_-phimin_)/double((nphi_-1)*repeat_phi_); } size_t PatternDisk::repeatPhi() const { return repeat_phi_; } @@ -217,15 +217,15 @@ void PatternDisk::dnu(double dfreq) { dnu_ = dfreq; } double PatternDisk::dnu() const { return dnu_; } -void PatternDisk::phimin(double phimin) { - phimin_ = phimin; - if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1.); +void PatternDisk::phimin(double phimn) { + phimin_ = phimn; + if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double PatternDisk::phimin() const {return phimin_;} -void PatternDisk::phimax(double phimax) { - phimax_ = phimax; - if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1.); +void PatternDisk::phimax(double phimx) { + phimax_ = phimx; + if (nphi_>1) dphi_ = (phimax_-phimin_) / double(nphi_-1); } double PatternDisk::phimax() const {return phimax_;} @@ -341,7 +341,7 @@ nphi_ = naxes[1]; if (nphi_==1 || repeat_phi_==0) throwError("In PatternDisk::fitsRead: nphi is 1 or repeat_phi is 0!"); - dphi_ = (phimax_-phimin_)/double((nphi_-1.)*repeat_phi_); + dphi_ = (phimax_-phimin_)/double((nphi_-1)*repeat_phi_); // update rin_, rout_, nr_, dr_ nr_ = naxes[2]; @@ -439,7 +439,7 @@ if (nr_ == 1.) throwError("In PatternDisk::fitsRead: nr_ should not be 0 here!"); - dr_ = (rout_-rin_) / double(nr_-1.); + dr_ = (rout_-rin_) / double(nr_-1); if (fits_close_file(fptr, &status)) throwCfitsioError(status) ; fptr = NULL; @@ -451,15 +451,16 @@ char* pixfile = const_cast(filename_.c_str()); fitsfile* fptr = NULL; int status = 0; - long naxes [] = {nnu_, nphi_, nr_}; + long naxes [] = {long(nnu_), long(nphi_), long(nr_)}; long fpixel[] = {1,1,1}; char * CNULL=NULL; char ermsg[31] = ""; // ermsg is used in throwCfitsioError() ////// CREATE FILE - GYOTO_DEBUG << "creating file" << endl; + GYOTO_DEBUG << "creating file \"" << pixfile << "\"... "; fits_create_file(&fptr, pixfile, &status); + if (debug()) cerr << "done." << endl; fits_create_img(fptr, DOUBLE_IMG, 3, naxes, &status); if (status) throwCfitsioError(status) ; @@ -610,7 +611,7 @@ case GYOTO_COORDKIND_SPHERICAL: { double pos2[4] = {pos[0], pos[1], pos[2], pos[3]}; - pos2[1] = radius_ ? radius_[i[2]] : rin_+i[2]*dr_; + pos2[1] = radius_ ? radius_[i[2]] : rin_+double(i[2])*dr_; vel[1] = rprime; vel[2] = 0.; vel[3] = phiprime; @@ -670,10 +671,12 @@ void PatternDisk::setPatternVelocity(double omega) { Omega_ = omega; } double PatternDisk::getPatternVelocity() { return Omega_; } -int PatternDisk::setParameter(std::string name, std::string content) { +int PatternDisk::setParameter(std::string name, + std::string content, + std::string unit) { if (name == "File") fitsRead( content ); else if (name=="PatternVelocity") setPatternVelocity(atof(content.c_str())); - else return ThinDisk::setParameter(name, content); + else return ThinDisk::setParameter(name, content, unit); return 0; } @@ -687,11 +690,11 @@ } void PatternDisk::setParameters(FactoryMessenger* fmp) { - string name, content; + string name, content, unit; setMetric(fmp->getMetric()); - while (fmp->getNextParameter(&name, &content)) { - if (name == "File") setParameter(name, fmp -> fullPath(content)); - else setParameter(name, content); + while (fmp->getNextParameter(&name, &content, &unit)) { + if (name == "File") setParameter(name, fmp -> fullPath(content), unit); + else setParameter(name, content, unit); } } #endif diff -Nru gyoto-0.0.3/lib/PatternDiskBB.C gyoto-0.1.0/lib/PatternDiskBB.C --- gyoto-0.0.3/lib/PatternDiskBB.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/PatternDiskBB.C 2013-07-27 09:14:20.000000000 +0000 @@ -45,7 +45,7 @@ PatternDisk(), spectrumBB_(NULL), SpectralEmission_(0), PLDisk_(0), - PLSlope_(0.), PLRho_(0.), rmax_(DBL_MAX), rPL_(DBL_MAX) + PLSlope_(0.), PLRho_(0.), rPL_(DBL_MAX) { GYOTO_DEBUG << "PatternDiskBB Construction" << endl; spectrumBB_ = new Spectrum::BlackBody(); @@ -55,7 +55,7 @@ PatternDisk(o), spectrumBB_(NULL), SpectralEmission_(o.SpectralEmission_), PLDisk_(o.PLDisk_), - PLSlope_(o.PLSlope_),PLRho_(o.PLRho_),rmax_(o.rmax_),rPL_(o.rPL_) + PLSlope_(o.PLSlope_),PLRho_(o.PLRho_),rPL_(o.rPL_) { GYOTO_DEBUG << "PatternDiskBB Copy" << endl; if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); @@ -67,7 +67,7 @@ GYOTO_DEBUG << "PatternDiskBB Destruction" << endl; } -double const * const PatternDiskBB::getVelocity() const { return PatternDisk::getVelocity(); } +double const * PatternDiskBB::getVelocity() const { return PatternDisk::getVelocity(); } void PatternDiskBB::getVelocity(double const pos[4], double vel[4]) { double rcur=projectedRadius(pos); @@ -78,13 +78,22 @@ break; default: throwError("PatternDiskBB::getVelocity: bad COORDKIND"); + risco=0.; } - + + double const * const radius=getGridRadius(); + size_t i[3]; // {i_nu, i_phi, i_r} + //Search for indices only in non-power-law region + if (rcurrPL_) || !getVelocity()){ //Keplerian circ velocity for power law disk region //as well as if PatternDisk::velocity_ not provided ThinDisk::getVelocity(pos, vel); - }else if (rcur rmax_ || rcur < risco) return 0.; // no emission in any case above rmax_ + // if (rcur > rout_ || rcur < risco) return 0.; // no emission in any case above rmax_ size_t i[3]; // {i_nu, i_phi, i_r} //Search for indices only in non-power-law region if (rcur rmax_ || rgrid < risco) return 0.; // no emission in any case above rmax_ + double Iem=0.; - double const * const emission = getIntensity(); + double const * const emiss = getIntensity(); size_t naxes[3]; getIntensityNaxes(naxes); size_t nnu=naxes[0], nphi=naxes[1]; if (!SpectralEmission_){ if (rPL_ rPL_ should be DBL_MAX"); - Iem = emission[i[2]*(nphi*nnu)+i[1]*nnu+i[0]]; + Iem = emiss[i[2]*(nphi*nnu)+i[1]*nnu+i[0]]; }else{ //Spectral emission double TT; if (rcur If rsetTemperature(TT); Iem=(*spectrumBB_)(nu); }else if (PLDisk_){ // -> If r>rPL_ compute temperature from first principles - //Get ISCO value (here metric is KerrBL, see setMetric) - double risco; - switch (gg_->getCoordKind()) { - case GYOTO_COORDKIND_SPHERICAL: - risco = static_cast >(gg_) -> getRms(); - break; - default: - throwError("PatternDiskBB::emission: bad COORDKIND"); - } - double rho_si = PLRho_*pow(rcur/risco,PLSlope_); //Assuming: pressure = kappa*(mass density)^gamma, gamma=5/3 (eq of state) // and: pressure = (mass density)*R/Mm*T (Mm = molar mass) @@ -184,7 +188,9 @@ ThinDisk::setMetric(gg); } -int PatternDiskBB::setParameter(std::string name, std::string content) { +int PatternDiskBB::setParameter(std::string name, + std::string content, + std::string unit) { if (name=="PLSlope"){ PLDisk_=1; PLSlope_=atof(content.c_str()); @@ -192,19 +198,14 @@ setOuterRadius(DBL_MAX);//infinite power law disk } else if (name=="PLRho") PLRho_=atof(content.c_str()); - else if (name=="Rmax") { - rmax_=atof(content.c_str()); - setOuterRadius(rmax_);//update outer radius - } else if (name=="SpectralEmission") SpectralEmission_=1; - else return PatternDisk::setParameter(name, content); + else return PatternDisk::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void PatternDiskBB::fillElement(FactoryMessenger *fmp) const { if (PLSlope_) fmp->setParameter("PLSlope", PLSlope_); - if (rmax_) fmp->setParameter("Rmax", rmax_); fmp -> setParameter ( SpectralEmission_? "SpectralEmission" : "BolometricEmission"); PatternDisk::fillElement(fmp); } diff -Nru gyoto-0.0.3/lib/Photon.C gyoto-0.1.0/lib/Photon.C --- gyoto-0.0.3/lib/Photon.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Photon.C 2013-07-27 09:14:20.000000000 +0000 @@ -21,7 +21,6 @@ #include "GyotoFactoryMessenger.h" #include "GyotoPhoton.h" #include "GyotoScreen.h" -#include "GyotoWorldlineIntegState.h" #include "GyotoDefs.h" #include "GyotoError.h" @@ -34,15 +33,15 @@ #include #include -#define COUNT_MAX 100000 - using namespace std; using namespace Gyoto; Photon::Photon() : - Worldline(), freq_obs_(1.), - transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) + Worldline(), + object_(NULL), + freq_obs_(1.), transmission_freqobs_(1.), + spectro_(NULL), transmission_(NULL) {} Photon::Photon(const Photon& o) : @@ -51,7 +50,10 @@ freq_obs_(o.freq_obs_), transmission_freqobs_(o.transmission_freqobs_), spectro_(NULL), transmission_(NULL) { - if (o.object_()) object_ = o.object_ -> clone(); + if (o.object_()) { + object_ = o.object_ -> clone(); + object_ -> setMetric(metric_); + } if (o.spectro_()) { spectro_ = o.spectro_ -> clone(); _allocateTransmission(); @@ -75,18 +77,23 @@ Photon(orig, i0, dir, step_max), parent_(orig) { + setFreqObs(orig->getFreqObs()); } -Photon::Photon(SmartPointer met, SmartPointer obj, +Photon::Photon(SmartPointer met, + SmartPointer obj, double* coord): - Worldline(), transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) + Worldline(), freq_obs_(1.), transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) { setInitialCondition(met, obj, coord); } -Photon::Photon(SmartPointer met, SmartPointer obj, - SmartPointer screen, double d_alpha, double d_delta): - Worldline(), object_(obj), transmission_freqobs_(1.), +Photon::Photon(SmartPointer met, + SmartPointer obj, + SmartPointer screen, + double d_alpha, double d_delta): + Worldline(), object_(obj), freq_obs_(screen->getFreqObs()), + transmission_freqobs_(1.), spectro_(NULL), transmission_(NULL) { double coord[8]; @@ -128,11 +135,11 @@ object_=ao; } -void Photon::setSpectrometer(SmartPointer spr) { +void Photon::setSpectrometer(SmartPointer spr) { spectro_=spr; _allocateTransmission(); } -SmartPointer Photon::getSpectrometer() const { return spectro_; } +SmartPointer Photon::getSpectrometer() const { return spectro_; } string Photon::className() const { return string("Photon"); } @@ -151,7 +158,7 @@ double coord[8]; screen -> getRayCoord(d_alpha, d_delta, coord); Worldline::setInitialCondition(met, coord, -1); - object_=obj; + if (obj) object_=obj; } @@ -159,23 +166,9 @@ SmartPointer obj, const double coord[8]) { - - /*if(debug()) cout << coord[0] << " " - << coord[1] << " " - << coord[2] << " " - << coord[3] << " " - << coord[4] << " " - << coord[5] << " " - << coord[6] << " " - << coord[7] << endl;*/ - double gtt0=met->gmunu(coord,0,0); - double ObsVel[4]={sqrt(-1./gtt0),0.,0.,0.}; - double sp_rec=met->ScalarProd(coord,coord+4,ObsVel); - freq_obs_ = -sp_rec; - // cout << "ut= " << sqrt(-1./gtt0) << endl; - // cout << "In Photon.C: freq obs= " << freq_obs_ << endl; + if (!met) met = metric_; Worldline::setInitialCondition(met, coord, -1); - object_=obj; + if (obj) object_=obj; } int Photon::hit(Astrobj::Properties *data) { @@ -187,7 +180,7 @@ depending on object_'s Astrobj::Properties) will be stored in data. */ - //tlim_=-1000.;//DEBUG //NB: integration stops when t < Worldline::tlim_ + //tmin_=-1000.;//DEBUG //NB: integration stops when t < Worldline::tmin_ transmission_freqobs_=1.; size_t nsamples; @@ -204,7 +197,7 @@ //with small fixed step will be performed to determine more precisely //the surface point. double coord[8]; - int dir=(tlim_>x0_[i0_])?1:-1; + int dir=(tmin_>x0_[i0_])?1:-1; size_t ind=i0_; int stopcond=0; double rr=DBL_MAX, rr_prev=DBL_MAX; @@ -217,8 +210,8 @@ */ for (ind=i0_+dir; ((dir==1)? - (ind<=imax_ && x0_[ind]<=tlim_): // conditions if dir== 1 - (ind>=imin_ && x0_[ind]>=tlim_)) // conditions if dir==-1 + (ind<=imax_ && x0_[ind]<=tmin_): // conditions if dir== 1 + (ind>=imin_ && x0_[ind]>=tmin_)) // conditions if dir==-1 && !hitt; // condition in all cases ind+=dir) { switch (coordkind) { @@ -235,13 +228,15 @@ if (rr Impact(this, ind, data); if (hitt) { - if (debug()) cerr << "DEBUG: Photon.C: Hit for already computed position; " - << "Warning: radiative transfer not implemented " - << "for that case" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "DEBUG: Photon.C: Hit for already computed position; " + << "Warning: radiative transfer not implemented " + << "for that case" << endl; +# endif return hitt; } else if (((dir==1)? - (ind==imax_ && x0_[ind]>=tlim_): // conditions if dir== 1 - (ind>=imin_ && x0_[ind]<=tlim_)) // conditions if dir==-1 + (ind==imax_ && x0_[ind]>=tmin_): // conditions if dir== 1 + (ind>=imin_ && x0_[ind]<=tmin_)) // conditions if dir==-1 && !hitt) return hitt; if (ind!=i0_) ind-=dir; @@ -271,8 +266,8 @@ throwError("Incompatible coordinate kind in Photon.C"); } - SmartPointer state - = new WorldlineIntegState(metric_, coord, delta_* dir); + SmartPointer state + = new Worldline::IntegState(this, coord, delta_* dir); //delta_ = initial integration step (defaults to 0.01) size_t count=0;// Must remain below count_max (prevents infinite integration) @@ -286,7 +281,7 @@ - transmission_freqobs_ low [see transmission() function in astrobjs, which defaults to 0 (optically thick) or 1 (optically thin) in Astrobj.C] - - t < tlim_ (if dir=-1), [NB: tlim_ defaults to 0 in Worldline.C] + - t < tmin_ (if dir=-1), [NB: tmin_ defaults to -DBL_MAX in Worldline.C] - photon is at r>rmax (defined for each object) and goes even further - metric tells it's time to stop (eg horizon crossing) - t does not evolve [to investigate, metric should have stopped @@ -297,9 +292,11 @@ while (!stopcond) { // Next step along photon's worldline - stopcond = state -> nextStep(this, coord); + stopcond = state -> nextStep(coord); if (stopcond) { - if (debug()) cerr<<"DEBUG: Photon::hit(): stopcond set by integrator\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "stopcond set by integrator\n"; +# endif break; } if (coord[0] == x0_[ind]) { // here, ind denotes previous step @@ -309,14 +306,15 @@ break; } if((stopcond=metric_->isStopCondition(coord))) { - if (debug()) cerr << "DEBUG: Photo::hit(): stopcond step by metric"< COUNT_MAX ) { - if (verbose()>= GYOTO_SEVERE_VERBOSITY) - cerr << "***WARNING (severe): Photon::hit: too many iterations, break" - << endl; + if ( ++count > maxiter_ ) { + GYOTO_SEVERE << "***WARNING (severe): Photon::hit: too many iterations, " + <<" break" << endl; stopcond = 1; break; } @@ -336,9 +334,10 @@ if (dir==1) ++imax_; else --imin_; if (imin_!=ind && imax_!=ind) { - if (debug()) cerr << "\nimin_=" << imin_ - << ", imax_=" << imax_ - << ", ind=" << ind << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "imin_=" << imin_ << ", imax_=" << imax_ + << ", ind=" << ind << endl; +# endif throwError("BUG: Photon.C: bad index evolution, " "ind should be equal to imin or imax"); } @@ -359,26 +358,43 @@ throwError("Incompatible coordinate kind in Photon.C"); } - if (debug()) - cerr << "DEBUG: Photon::hit(): rmax="<< rmax <<", rr="< Impact(this, ind, data); if (hitt && !data) stopcond=1; - if (debug()) cerr << "DEBUG: Photon::hit(): transmission_freqobs_=" - << transmission_freqobs_ << endl; - if ( transmission_freqobs_ < 1e-6 ) { + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(transmission_freqobs_); +# endif + + if ( getTransmissionMax() < 1e-6 ) { stopcond=1; - if (debug()) - cerr << "DEBUG: Photon::hit(): stopping because we " - << "are optically thick\n"; + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "stopping because we are optically thick\n"; +# endif + } } else { if ( rr > rr_prev ) { - if (debug()) - cerr << "DEBUG: Photon::hit(): Stopping because " - << "1) we are far from this object and " - << "2) we are flying away" << endl; + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "Stopping because " + << "1) we are far from this object and " + << "2) we are flying away" << endl; +# endif + stopcond=1; break; } @@ -390,15 +406,15 @@ //************************************ /* - 3-c Checks whether t < tlim_ (with dir=-1) and expands arrays + 3-c Checks whether t < tmin_ (with dir=-1) and expands arrays if necessary to be able to store next step's results */ switch (dir) { case 1: - if (coord[0]>tlim_) { - if (debug()) - cerr << "DEBUG: Photon::hit(): stopping because time " - << "goes beyond time limit\n"; + if (coord[0]>tmin_) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "stopping because time goes beyond time limit\n"; +# endif stopcond=1; } if ((!stopcond) && (ind==x_size_)) { @@ -407,10 +423,10 @@ } break; default: - if (coord[0]GYOTO_T_TOL) && (curval>threshold) ) { pcur[0] = 0.5*(t1+t2); - getCoord(pcur, 1, pcur+1, pcur+2, pcur+3); + getCoord(pcur, 1, pcur+1, pcur+2, pcur+3, pcur+4, pcur+5, pcur+6, pcur+7); curval=(*object)(pcur); if (val1 GYOTO_T_TOL) { pcur[0] = 0.5*(tinside+toutside); - getCoord(pcur, 1, pcur+1, pcur+2, pcur+3); + getCoord(pcur, 1, pcur+1, pcur+2, pcur+3, pcur+4, pcur+5, pcur+6, pcur+7); if ( (*object)(pcur) < value ) tinside = pcur[0]; else toutside = pcur[0]; } toutside = tinside; } -double Photon::getFreqObs() const { return freq_obs_; } +void Photon::setFreqObs(double fo) { + freq_obs_=fo; + GYOTO_DEBUG_EXPR(freq_obs_); +} +double Photon::getFreqObs() const { + GYOTO_DEBUG_EXPR(freq_obs_); + return freq_obs_; +} double Photon::getTransmission(size_t i) const { if (i==size_t(-1)) return transmission_freqobs_; @@ -489,15 +513,31 @@ throwError("Photon::getTransmission(): i > nsamples"); return transmission_[i]; } + +double Photon::getTransmissionMax() const { + double transmax=transmission_freqobs_; + if (spectro_()) { + size_t i=0, imax= spectro_->getNSamples(); + for (i=0; i < imax; ++i) + if (transmission_[i] > transmax) + transmax = transmission_[i]; + } +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(transmax); +# endif + return transmax; +} + double const * Photon::getTransmission() const { return transmission_; } void Photon::transmit(size_t i, double t) { if (i==size_t(-1)) { transmission_freqobs_ *= t; return; } if (!spectro_() || i>=spectro_->getNSamples()) throwError("Photon::getTransmission(): i > nsamples"); transmission_[i] *= t; - if (debug()) - cerr << "DEBUG: Photon::transmit(i="<transmit(i, t); @@ -507,37 +547,19 @@ #ifdef GYOTO_USE_XERCES void Photon::fillElement(FactoryMessenger *fmp) { - if (metric_) fmp -> setMetric (metric_) ; if (object_) fmp -> setAstrobj (object_) ; - - double coord[8]; - getInitialCoord(coord); - fmp -> setParameter("InitCoord", coord, 8); - - if (delta_ != GYOTO_DEFAULT_DELTA) - fmp -> setParameter ("Delta", delta_); + Worldline::fillElement(fmp); } -SmartPointer Gyoto::PhotonSubcontractor(FactoryMessenger* fmp) { +SmartPointer Gyoto::Photon::Subcontractor(FactoryMessenger* fmp) { string name="", content=""; SmartPointer gg = NULL; SmartPointer ao = NULL; SmartPointer ph = new Photon(); - ph -> setMetric( fmp->getMetric() ); ph -> setAstrobj( fmp->getAstrobj() ); - - - while (fmp->getNextParameter(&name, &content)) { - char* tc = const_cast(content.c_str()); - if(name=="Delta") ph -> setDelta( atof(tc) ); - if(name=="InitCoord") { - double coord[8]; - for (int i=0;i<8;++i) coord[i] = strtod(tc, &tc); - ph -> setInitCoord(coord, -1); - } - } + ph -> setParameters(fmp); return ph; } diff -Nru gyoto-0.0.3/lib/PolishDoughnut.C gyoto-0.1.0/lib/PolishDoughnut.C --- gyoto-0.0.3/lib/PolishDoughnut.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/PolishDoughnut.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,1395 @@ +/* + Copyright (c) 2012 Frederic Vincent, Odele Straub, Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include "GyotoUtils.h" +#include "GyotoPolishDoughnut.h" +#include "GyotoPhoton.h" +#include "GyotoFactoryMessenger.h" +#include "GyotoDefs.h" + +#include +#include +#include +#include +#include + +using namespace std; +using namespace Gyoto; +using namespace Gyoto::Astrobj; + +#define CST_POLY_INDEX 1.5//polytropic index (gamma=1+1/n=5/3) +#define CST_POLY_INDEX_M1 0.666666666666666666666666666666666666666667 + // 1./ CST_POLY_INDEX +#define CST_HYDRO_FRAC 0.75//hydrogen fraction +#define CST_Z_1 1.//atomic number +#define CST_Z_2 2. +#define CST_MU_ION 1.2307692307692308375521861 //(4./(1. + 3. * CST_HYDRO_FRAC)) +#define CST_MU_ELEC 1.1428571428571427937015414 //(2./(1. + CST_HYDRO_FRAC)) + +#define GYOTO_C2_CGS 8.98755178736817668096e+20 //c^2 in cgs +#define GYOTO_C2_CGS_M1 1.1126500560536184087938986e-21 // 1./GYOTO_C2_CGS +#define w_tol 1e-9 + +PolishDoughnut::PolishDoughnut() : + Standard("PolishDoughnut"), + gg_(NULL), + l0_(0.), + lambda_(0.5), + W_surface_(0.), + W_centre_(0.), + r_cusp_(0.), + r_centre_(0.), + temperature_ratio_(1.), + central_density_(1.), + centraltemp_over_virial_(1.), + beta_(0.), + use_specific_impact_(0), + //aa_ and aa2_ are set by setLambda() + spectral_oversampling_(10) + //intersection doesn't need initilizing +{ +#ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +#endif + critical_value_=0.; safety_value_=.1; //rmax_=25.; +} + +PolishDoughnut::PolishDoughnut(const PolishDoughnut& orig) : + Standard(orig), + gg_(NULL), + l0_(orig.l0_), + lambda_(orig.lambda_), + W_surface_(orig.W_surface_), + W_centre_(orig.W_centre_), + r_cusp_(orig.r_cusp_), + r_centre_(orig.r_centre_), + DeltaWm1_(orig.DeltaWm1_), + temperature_ratio_(orig.temperature_ratio_), + central_density_(orig.central_density_), + centraltemp_over_virial_(orig.centraltemp_over_virial_), + beta_(orig.beta_), + use_specific_impact_(orig.use_specific_impact_), + aa_(orig.aa_), + aa2_(orig.aa2_), + spectral_oversampling_(orig.spectral_oversampling_), + intersection(orig.intersection) +{ + if (orig.gg_()) { + gg_=orig.gg_->clone(); + Standard::gg_ = gg_; + } +} +PolishDoughnut* PolishDoughnut::clone() const +{return new PolishDoughnut(*this);} + +double PolishDoughnut::getL0() const { return l0_; } +//void PolishDoughnut::setL0(double l0) { l0_ = l0; } +double PolishDoughnut::getWsurface() const { return W_surface_; } +double PolishDoughnut::getWcentre() const { return W_centre_; } +double PolishDoughnut::getRcusp() const { return r_cusp_; } +double PolishDoughnut::getRcentre() const { return r_centre_; } + +double PolishDoughnut::getLambda() const { return lambda_; } +void PolishDoughnut::setLambda(double lambda) { + if (!gg_) throwError("Metric but be set before lambda in PolishDoughnut"); + //Computing marginally stable and marginally bound radii: + lambda_=lambda; + aa_=gg_->getSpin(), aa2_=aa_*aa_; + + double rms = gg_->getRms();//(3. + z2 - pow((3. - z1)*(3. + z1 + + // 2.*z2),1./2.)); + double rmb = gg_->getRmb();//pow(1. + sqrt(1. - aa),2); + + // marginally stable & marginally bound keplerian angular momentum + // lK(rms), lK(rmb): NB: this is Bardeen 74 L/E (2.12-2.13), not L + // (Polish doughnut l is rescaled) + double l_ms + = (rms*rms - 2.*aa_*sqrt(rms) + aa2_)/(pow(rms,3./2.) - 2.*sqrt(rms) + aa_); + double l_mb + = (rmb*rmb - 2.*aa_*sqrt(rmb) + aa2_)/(pow(rmb,3./2.) - 2.*sqrt(rmb) + aa_); + + l0_ = lambda_*(l_mb-l_ms)+l_ms ;//torus angular momentum + + //Computing the potential at the photon position: + double r1_min = rmb ; + double r1_max = rms ; + double r2_min = rms ; + double r2_max = 1000. ; + + // update intersection functor: + intersection.aa_=aa_; + intersection.aa2_=aa2_; + intersection.l0_=l0_; + + r_cusp_ = intersection.ridders(r1_min, r1_max) ; + r_centre_ = intersection.ridders(r2_min, r2_max) ; + W_surface_ = potential(r_cusp_, M_PI/2.) ; + W_centre_ = potential(r_centre_, M_PI/2.) ; + + GYOTO_IF_DEBUG + GYOTO_DEBUG_EXPR(lambda_); + GYOTO_DEBUG_EXPR(l0_); + GYOTO_DEBUG_EXPR(aa_); + GYOTO_DEBUG_EXPR(r_cusp_); + GYOTO_DEBUG_EXPR(r_centre_); + GYOTO_DEBUG_EXPR(W_surface_); + GYOTO_DEBUG_EXPR(W_centre_); + GYOTO_ENDIF_DEBUG + + DeltaWm1_= 1./(W_centre_ - W_surface_); + +} + +double PolishDoughnut::getTemperatureRatio() const {return temperature_ratio_;} +void PolishDoughnut::setTemperatureRatio(double t){temperature_ratio_=t;} + +double PolishDoughnut::getCentralDensity() const {return central_density_;} +double PolishDoughnut::getCentralDensity(string unit) const { + double dens = getCentralDensity(); + if (unit != "") { +# ifdef HAVE_UDUNITS + dens = Units::Converter("kg/L", unit)(dens); +# else + GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" + << endl ; +# endif + } + return dens; +} +void PolishDoughnut::setCentralDensity(double dens) { + central_density_=dens; +} +void PolishDoughnut::setCentralDensity(double dens, string unit) { + if (unit != "") { +# ifdef HAVE_UDUNITS + dens = Units::Converter(unit, "kg/L")(dens); +# else + GYOTO_WARNING << "Units ignored, please recompile Gyoto with --with-udunits" + << endl ; +# endif + } + setCentralDensity(dens); +} + +double PolishDoughnut::getCentralTempOverVirial() const +{return centraltemp_over_virial_;} +void PolishDoughnut::setCentralTempOverVirial(double val) +{centraltemp_over_virial_=val;} + +double PolishDoughnut::getBeta() const { return beta_; } +void PolishDoughnut::setBeta(double beta) { beta_ = beta; } + +size_t PolishDoughnut::getSpectralOversampling() const +{ return spectral_oversampling_; } +void PolishDoughnut::setSpectralOversampling(size_t val) +{ spectral_oversampling_ = val; } + +PolishDoughnut::~PolishDoughnut() { + GYOTO_DEBUG << "PolishDoughnut Destruction" << endl; + if (gg_) gg_ -> unhook(this); +} + +Gyoto::SmartPointer PolishDoughnut::getMetric() const { + return SmartPointer(gg_); +} +void PolishDoughnut::setMetric(Gyoto::SmartPointer met) +{ + if (met->getKind() != "KerrBL") + throwError("PolishDoughnut::setMetric(): only KerrBL, please"); + if (gg_) gg_ -> unhook(this); + gg_ = SmartPointer(met); + Generic::gg_ = gg_; + if (gg_) gg_ -> hook(this); + GYOTO_DEBUG << "Metric set, calling setLambda\n"; + setLambda(lambda_); // setLambda_ initializes other members +} + +void PolishDoughnut::tell(Hook::Teller * met) { + if (met == gg_) setLambda(lambda_); + else throwError("BUG: PolishDoughnut::tell(Hook::Teller * met) called with" + "wrong metric"); +} + +int PolishDoughnut::Impact(Photon *ph, size_t index, + Astrobj::Properties *data) { + if (beta_==1.) throwError("Please set beta to != 1."); + GYOTO_DEBUG_EXPR(use_specific_impact_); + if (use_specific_impact_) + return Impact_(ph, index, data); + return Standard::Impact(ph, index, data); +} + +int PolishDoughnut::Impact_(Photon *ph, size_t index, + Astrobj::Properties *data) { + /* + Should not be used anymore, use Standard::Impact + */ + GYOTO_DEBUG << endl; + + // int width=15, prec=12; + double coord_ph_hit[8], coord_obj_hit[8]; + double dt = 0.1; // seems to be OK if not so little (0.1) + int hit=0; + double coord[8], coord2[8]; + ph->getCoord(index, coord2); // coord2 is the earliest point, t2getCoord(index+1, coord); // which must be processed last + + double t1=coord[0], r1=coord[1], theta1=coord[2], + tprev=t1, rprev=r1, thetaprev=theta1, + t2=coord2[0], r2=coord2[1], theta2=coord2[2], + tcur, rcur, thetacur, phicur, tdotcur, rdotcur, thetadotcur, phidotcur; + // remember : t1 > t2, we integrate backwards in time + //NB: to keep in mind: inside doughnut 0<=w<=1 with w=0 at the surface, + // outside, excluding the funnel w<0, in the funnel w>0 (can be >1) + // Funnel = open field lines with projected distance to the axis < r_cusp_ + double wcur, w1 = (potential(r1, theta1) - W_surface_)*DeltaWm1_, wprev = w1 ; + double w2 = (potential(r2, theta2) - W_surface_)*DeltaWm1_; + + double w_lim=3.; + + if (debug()) + cerr << "DEBUG: PolishDoughnut::Impact():" + << "w1=" << w1 << ", w2=" << w2 + << ", r1*sin(theta1)/r_cusp_="< 1 outside the funnel!"); + + //checks whether both w are far from 0 (surface value) or inside funnel + //if yes: no impact + if ( (w1 < 0.-w_lim || r1*fabs(sin(theta1)) < r_cusp_) + && (w2 < 0.-w_lim || r2*fabs(sin(theta2)) < r_cusp_) ) { + return 0; + } + + coord_obj_hit[5] = 0.; + coord_obj_hit[6] = 0.; + double tfirst = t1, tlast=t2, wfirst=w1, wlast=w2; + + + // At least one of the ends is close to the doughnut. Refine. We + // want t1 inside the object. If entering the object, we want to + // stay close to the surface. + if ( r1*fabs(sin(theta1)) < r_cusp_ ) { + // t1 is in the funnel. So t2 is not (see if loop above). + // Bring t1 closer to t2, outside funnel. + tfirst=t1; tlast=t2; + while ((tfirst-tlast)>GYOTO_T_TOL) { + tcur = 0.5*(tfirst+tlast); + ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, + &tdotcur, &rdotcur, &thetadotcur, &phidotcur); + if (rcur*fabs(sin(thetacur)) look for + // a maximum in between, is it inside the object ? + if (debug()) + cout << "DEBUG: PD::Impact():" + << "t1 and t2 close to surface" + << endl; + while (wcur < 0.) { + if ((tfirst-tlast) getCoord( &tcur, 1, &rcur, &thetacur, &phicur, + &tdotcur, &rdotcur, &thetadotcur, &phidotcur); + wcur = (potential(rcur, thetacur) - W_surface_)*DeltaWm1_; + if (wlast < wfirst) { + tlast=tcur; wlast=wcur; + } else { + tfirst=tcur; wfirst=wcur; + } + } + } + wlast=wcur; tlast=tcur; + + if (rcur*fabs(sin(thetacur)) check this one if new bug + if (wcur<0) {tfirst=tcur; wfirst=wcur; } + else { tlast=tcur; wlast=wcur; } + } + // tlast, wlast is inside of the object, close to the surface: + t1=tlast; w1=wlast; + if (debug()) + cerr << "DEBUG: PD::Impact(): found entry point: t1="<0). t1 is in the object by now. + // Bring t2 out of the funnel, just outside doughnut (with w2<0) + tfirst=t1; tlast=t2; + while ((tfirst-tlast)>GYOTO_T_TOL) { + tcur = 0.5*(tfirst+tlast); + ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, + &tdotcur, &rdotcur, &thetadotcur, &phidotcur); + if (rcur*fabs(sin(thetacur))>r_cusp_) tfirst=tcur; + else tlast=tcur; + } + t2=tcur; + w2 =(potential(rcur, thetacur) - W_surface_)*DeltaWm1_; + if (debug()) + cerr << "DEBUG: PD::Impact: Funnel handling for t2," + << " new w2="<GYOTO_T_TOL) { + tcur = 0.5*(tfirst+tlast); + ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, + &tdotcur, &rdotcur, &thetadotcur, &phidotcur); + wcur = (potential(rcur, thetacur) - W_surface_)*DeltaWm1_; + if (debug()) + cerr << "DEBUG: PD::Impact: wfirst="< 0.) { tfirst=tcur; wfirst=wcur; } + else { tlast=tcur; wlast=wcur; } + } + t2=tcur; w2=wcur; + } + // Phew, now both t1 and t2 are inside the object. Guaranteed. + // Now we split the line in small bits by interpolation. + if (debug()) + cerr << "DEBUG: PD::Impact(): ***HIT*** interpolating worldline between " + << "t1="< getCoord( &tcur, 1, &rcur, &thetacur, &phicur, + &tdotcur, &rdotcur, &thetadotcur, &phidotcur); + + coord_obj_hit[0] = coord_ph_hit[0] = tcur; + coord_obj_hit[1] = coord_ph_hit[1] = rcur; + coord_obj_hit[2] = coord_ph_hit[2] = thetacur; + coord_obj_hit[3] = coord_ph_hit[3] = phicur; + coord_ph_hit[4] = tdotcur; + coord_ph_hit[5] = rdotcur; + coord_ph_hit[6] = thetadotcur; + coord_ph_hit[7] = phidotcur; + + gtt=gg_->gmunu(coord_ph_hit,0,0); + gtph=gg_->gmunu(coord_ph_hit,0,3); + gphph=gg_->gmunu(coord_ph_hit,3,3); + Omega=-(l0_*gtt+gtph)/(l0_*gtph+gphph); + ut2=-1./(gtt+2.*gtph*Omega+gphph*Omega*Omega); + if (ut2 < 0.) + throwError("In PolishDoughnut.C PROBLEM!!!: ut^2 is negative."); + coord_obj_hit[4] = sqrt(ut2); + coord_obj_hit[7] = Omega*sqrt(ut2); + + processHitQuantities(ph, coord_ph_hit, coord_obj_hit, 1., data); + return hit; + } + + //RADIATIVE TRANSFER CASE + for (tprev = t1, tcur=t1-dt; + tprev>t2; + tprev=tcur, wprev=wcur, rprev=rcur, thetaprev=thetacur, tcur-=dt) { + if (tcur < t2) tcur=t2; + ph -> getCoord( &tcur, 1, &rcur, &thetacur, &phicur, + &tdotcur, &rdotcur, &thetadotcur, &phidotcur); + wcur = (potential(rcur, thetacur) - W_surface_)*DeltaWm1_; + if (debug()) + cerr << "**********DEBUG: PD::Impact(): tcur="<gmunu(coord_ph_hit,0,0); + gtph=gg_->gmunu(coord_ph_hit,0,3); + gphph=gg_->gmunu(coord_ph_hit,3,3); + Omega=-(l0_*gtt+gtph)/(l0_*gtph+gphph); + ut2=-1./(gtt+2.*gtph*Omega+gphph*Omega*Omega); + if (ut2 < 0.) + throwError("In PolishDoughnut.C PROBLEM!!!: ut^2 is negative."); + coord_obj_hit[4] = sqrt(ut2); + coord_obj_hit[7] = Omega*sqrt(ut2); + + /*cout << "coords ph obj at hit= " << endl; + for (int ii=0;ii<8;ii++) + cout << coord_ph_hit[ii] << " "; + cout << endl; + for (int ii=0;ii<8;ii++) + cout << coord_obj_hit[ii] << " "; + cout << endl;*/ + + processHitQuantities(ph, coord_ph_hit, coord_obj_hit, tprev-tcur, data); + + } + if (debug()) + cerr<< "DEBUG: PD::Impact() returning after HIT" << endl; + return hit; +} + +double PolishDoughnut::operator()(double const coord[4]) { + // w1 = ((potential(r1, theta1, aa) - W_surface_) + // /(W_centre_ - W_surface_)); + // + // w1 < 0. outside polishdoughnut, anything inside funnel, 0 inside PolishDoughnut. + + double tmp = W_surface_-potential(coord[1], coord[2]); + double rproj = coord[1] * sin(coord[2]); + if (rprojgmunu(pos,0,0); + double gtph=gg_->gmunu(pos,0,3); + double gphph=gg_->gmunu(pos,3,3); + double Omega=-(l0_*gtt+gtph)/(l0_*gtph+gphph); + double ut2=-1./(gtt+2.*gtph*Omega+gphph*Omega*Omega); + if (ut2 < 0.) { + stringstream ss; + ss << "PolishDoughnut::getVelocity(pos=["; + for (int i=0; i<3; ++i) ss << pos[i] << ", "; + ss << pos[3] << "]): ut^2 is negative."; + throwError(ss.str()); + } + vel[0] = sqrt(ut2); + vel[1] = vel[2] = 0.; + vel[3] = Omega*sqrt(ut2); +} + +void PolishDoughnut::integrateEmission + (double * I, double * boundaries, + size_t * chaninds, size_t nbnu, + double dsem, double *cph, double *co) const +{ + // The original channels may or may not be contiguous. We split + // each original channels into spectral_oversampling_ subchannels. + // All we know is that each chunk of spectral_oversampling_ + // subchannels are contiguous. Don't try to recover contiguousness + // in the original channels, it's too hard for now. + double som1=1./double(spectral_oversampling_); + size_t onbnu=nbnu*spectral_oversampling_; // number of subchannels + size_t onbb = onbnu+nbnu; // number of subchannel boundaries : most + // are used twice as subchannels are + // contiguous in each channel. + double * Inu = new double[onbnu+1]; + double * bo = new double[onbb]; + size_t * ii = new size_t[2*onbnu]; // two indices for each subchannel + double dnu; + size_t k=0; + for (size_t i=0; i(this)->getVelocity(coord_obj, vel); + //double Omega=vel[3]/vel[0]; + + double Msgr = gg_->getMass()*1e3; // Gyoto speaks in SI --> here we + // switch to cgs units + double rr = coord_ph[1], theta = coord_ph[2];//NB: rr is units of GM/c^2 + + //rr=8.00926;theta=M_PI/2.; //TEST!!!!! + //nu_em = 1e24; //TEST!!! + + double rcgs = rr * gg_ -> unitLength() * 100.;//rr in cgs + //r_centre_ in cgs: + double r_centre_cgs = r_centre_ * gg_ -> unitLength() * 100.; + double ww = (potential(rr, theta) - W_surface_)*DeltaWm1_; + + if (ww<=0.){//Will generate nan in computations w must be strictly positive + if (fabs(ww)0.){ + xmax*=10.; + } + xM_crit = transcendental.ridders(xmin, xmax) ; + } + // cout << "xmin="< 0 + nu_crit shifted brems (NB not shifted if + comptonorder=0, in this case amplinu=nu) + nu_em>numax -> wien tail smoothly connected to previous brems + */ + + double temp_e = GYOTO_BOLTZMANN_CGS * T_electron + / (GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS) ; + double Fee, Fei; + + if (temp_e < 1.) { + Fee = 20./(9.*sqrt(M_PI))*(44.- 3.*M_PI*M_PI)*pow(temp_e,3./2.) + *(1.+1.1*temp_e+temp_e*temp_e - 1.25*pow(temp_e,5./2.)); + Fei = 4.*sqrt(2.*temp_e / (M_PI*M_PI*M_PI))*(1.+1.781*pow(temp_e,1.34)); + }else{ + Fee = 24.*temp_e*(log(2.*exp(-GYOTO_EULER_MASCHERONI)*temp_e)+1.28); + Fei = 9.*temp_e / (2.*M_PI)*(log(1.123*temp_e + 0.48) + 1.5); + } + + double fee = n_e*n_e*GYOTO_C_CGS*GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS + *GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS + *GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS*GYOTO_ALPHA_F*Fee; + double fei = n_e*n_j*GYOTO_THOMSON_CGS*GYOTO_C_CGS + *GYOTO_ALPHA_F*GYOTO_ELECTRON_MASS_CGS + *GYOTO_C2_CGS*Fei; + double f_brems = fee + fei ; + + if (nu_em > nu_crit){ + if (nu_em < numax) { + /* Brems at shifted freq between nu_crit and numax */ + double Gaunt; // Gaunt factor at shifted frequency + if ( GYOTO_BOLTZMANN_CGS*T_electron/ + (GYOTO_PLANCK_CGS*nu_em) < 1.){ + Gaunt = sqrt( + 3./M_PI*GYOTO_BOLTZMANN_CGS*T_electron + /(GYOTO_PLANCK_CGS*amplinu) + ) ; + }else{ + Gaunt = sqrt(3.) / M_PI + * log( + 4./GYOTO_EULER_MASCHERONI * GYOTO_BOLTZMANN_CGS*T_electron + /(GYOTO_PLANCK_CGS*amplinu) + ) ; + } + //Brems emission at shifted freq: + double emissbrems = 1./(4.*M_PI)*f_brems*Gaunt + *exp(-GYOTO_PLANCK_CGS*amplinu/(GYOTO_BOLTZMANN_CGS*T_electron)) + * GYOTO_PLANCK_CGS/(GYOTO_BOLTZMANN_CGS*T_electron); + //NB: the 1/4pi factor is just to have the per steradian + //dependency, the emission being assumed isotropic in + //emitter's frame + return emissbrems*Cbrems; + } else { + /* Wien tail above numax */ + double MaxGaunt; // Gaunt factor with max frequency + if ( GYOTO_BOLTZMANN_CGS*T_electron/ + (GYOTO_PLANCK_CGS*numax) < 1.){ + MaxGaunt = sqrt( + 3./M_PI*GYOTO_BOLTZMANN_CGS*T_electron + /(GYOTO_PLANCK_CGS*numax) + ) ; + }else{ + MaxGaunt = sqrt(3.) / M_PI + * log( + 4./GYOTO_EULER_MASCHERONI * GYOTO_BOLTZMANN_CGS*T_electron + /(GYOTO_PLANCK_CGS*numax) + ) ; + } + //Wien tail smoothly connected to brems emission below numax: + double WienEm=BBapprox(nu_em,T_electron); + double WienEmMax = BBapprox(numax,T_electron); + double emissbremsmax = 1./(4.*M_PI)*f_brems*MaxGaunt + *exp(-GYOTO_PLANCK_CGS*numax/(GYOTO_BOLTZMANN_CGS*T_electron)) + * GYOTO_PLANCK_CGS/(GYOTO_BOLTZMANN_CGS*T_electron); + double emiss_bremsmax = Cbrems*emissbremsmax; + double fact = WienEmMax/emiss_bremsmax; + + return WienEm/fact; + } + }else{ + return 0.; + } +} + +double PolishDoughnut::emissionSynch(double nu_em, double nu_crit, + double numax, double nu_0, + double T_electron, + double amplification, + double Csynch, + double alpha1, double alpha2, + double alpha3, double preff, + int comptonorder) const{ + + double amplinu=nu_em; + if (comptonorder>0){ + amplinu/=pow(amplification,comptonorder); + Csynch=pow(Csynch,comptonorder); + }else if (Csynch!=1.) + throwError("In PolishDoughnut::emissionSynch: Csynch should be 1" + "if no Compton amplification"); + + /* + Cases: + nu_em Rayleigh-Jeans emission smoothly connected to + following synch emission + nu_crit shifted synchrotron (NB not shifted if + comptonorder=0, in this case amplinu=nu) + nu_em>numax -> 0 + */ + + double temp_e = GYOTO_BOLTZMANN_CGS * T_electron + / (GYOTO_ELECTRON_MASS_CGS*GYOTO_C2_CGS) ; + if (nu_emgetMass()*1e3; // Gyoto speaks in SI --> here we */ + /* // switch to cgs units */ + /* double rr = coord_ph[1], theta = coord_ph[2];//NB: rr is units of GM/c^2 */ + /* // double rcgs = rr * gg_ -> unitLength() * 100.;//rr in cgs */ + /* //r_centre_ in cgs: */ + /* double r_centre_cgs = r_centre_ * gg_ -> unitLength() * 100.; */ + /* double ww = (potential(rr, theta) - W_surface_)*DeltaWm1_; */ + /* if (ww<=0.){//Will generate nan in computations w must be strictly positive */ + /* if (fabs(ww)1./tol) //Wien + return 2.*GYOTO_PLANCK_CGS*nuem*nuem*nuem*GYOTO_C2_CGS_M1 + *exp(-HnuOverKt); + else //Planck + return 2.*GYOTO_PLANCK_CGS*nuem*nuem*nuem*GYOTO_C2_CGS_M1 + *1./(exp(HnuOverKt)-1.); +} + +double PolishDoughnut::funcxM(double alpha1, double alpha2, + double alpha3, double xM) { + //Mahadevan 96 fit function + return 4.0505*alpha1/pow(xM,1./6.) + *(1.+0.4*alpha2/pow(xM,1./4.)+0.5316*alpha3/sqrt(xM)) + *exp(-1.8899*pow(xM,1./3.)); +} + +// Intersection of the constant angular momentum l0 with the Keplerian one +//double PolishDoughnut::intersection(double rr) const +double PolishDoughnut::intersection_t::operator()(double rr) const + +{ + double y = ((rr*rr - 2.*aa_*sqrt(rr) + aa2_)/(pow(rr,3./2.) + - 2.*sqrt(rr) + aa_)) - l0_ ; + + return y ; // y = 0 gives 2 intersections, + //the cusp and the central radius of the torus +} + +// Solving the transcendental equation for "xM" numerically at each r +double PolishDoughnut::transcendental_t::operator()(double xM) const +{ + double rr = par[0] ; + double n_e = par[1] ; + double BB = par[2] ; + double Te = par[3] ; + double alpha1 = par[4] ; + double alpha2 = par[5] ; + double alpha3 = par[6] ; + + + double temp_e = GYOTO_BOLTZMANN_CGS*Te + /(GYOTO_ELECTRON_MASS_CGS*GYOTO_C_CGS*GYOTO_C_CGS); + double nu_0 = GYOTO_ELEMENTARY_CHARGE_CGS* BB + / (2. * M_PI * GYOTO_ELECTRON_MASS_CGS * GYOTO_C_CGS); + double func_xM = PolishDoughnut::funcxM(alpha1,alpha2,alpha3,xM); + double BesselK2 = bessk(2,1./temp_e); + double nuem = 3./2.*xM*nu_0*temp_e*temp_e; + +// double y = GYOTO_ELEMENTARY_CHARGE_CGS*GYOTO_ELEMENTARY_CHARGE_CGS +// /(sqrt(3.)*GYOTO_C_CGS) * (4.*M_PI*n_e)/BesselK2 +// * nuem * func_xM * 4./3.*M_PI*rr*rr*rr +// - M_PI * 2.*GYOTO_PLANCK_CGS/(GYOTO_C_CGS*GYOTO_C_CGS)*nuem*nuem*nuem +// / (exp(GYOTO_PLANCK_CGS*nuem/(GYOTO_BOLTZMANN_CGS*Te))-1.) +// * 4.*M_PI*rr*rr; + double Bnu=0.; + //if (exp(GYOTO_PLANCK_CGS*nuem/(GYOTO_BOLTZMANN_CGS*Te))==1.){ + //Rayleigh Jeans + //AJOUTER TEST hnu<2!"); + tox=2.0/xx; + bkm=bessk0(xx); + bk=bessk1(xx); + for(int j=1;jsetMetric(gg_); + fmp->setParameter("Lambda", lambda_); + fmp->setParameter("TempRatio", temperature_ratio_); + fmp->setParameter("CentralDensity", central_density_); + fmp->setParameter("CentralTempOverVirial", centraltemp_over_virial_); + fmp->setParameter("Beta", beta_); + if (use_specific_impact_) fmp->setParameter("UseSpecificImpact"); + fmp->setParameter("SpectralOversampling", spectral_oversampling_); + Standard::fillElement(fmp); +} +#endif diff -Nru gyoto-0.0.3/lib/PowerLawSpectrum.C gyoto-0.1.0/lib/PowerLawSpectrum.C --- gyoto-0.0.3/lib/PowerLawSpectrum.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/PowerLawSpectrum.C 2013-07-27 09:14:20.000000000 +0000 @@ -49,23 +49,14 @@ Spectrum::Generic::fillElement(fmp); } -SmartPointer -Gyoto::Spectrum::PowerLawSubcontractor(FactoryMessenger* fmp) { - SmartPointer sp = new Spectrum::PowerLaw(); - if (!fmp) return sp; - std::string name="", content=""; char *tc; - while (fmp->getNextParameter(&name, &content)) { - tc=const_cast(content.c_str()); - if (name=="Exponent") sp->setExponent(atof(tc)); - else if (name=="Constant") sp->setConstant(atof(tc)); - else sp -> setParameter(name, content); - } - return sp; +void Gyoto::Spectrum::PowerLaw::setParameter(std::string name, + std::string content, + std::string unit) { + char * tc=const_cast(content.c_str()); + if (name=="Exponent") setExponent(atof(tc)); + else if (name=="Constant") setConstant(atof(tc)); + else Spectrum::Generic::setParameter(name, content, unit); } -void Gyoto::Spectrum::PowerLawInit() { - Gyoto::Spectrum::Register("PowerLaw", - &Gyoto::Spectrum::PowerLawSubcontractor); -} #endif diff -Nru gyoto-0.0.3/lib/Register.C gyoto-0.1.0/lib/Register.C --- gyoto-0.0.3/lib/Register.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Register.C 2013-07-27 09:14:20.000000000 +0000 @@ -16,12 +16,13 @@ You should have received a copy of the GNU General Public License along with Gyoto. If not, see . */ - #include "GyotoRegister.h" #include "GyotoUtils.h" #include "GyotoAstrobj.h" #include "GyotoMetric.h" #include "GyotoSpectrum.h" +#include "GyotoSpectrometer.h" +#include "GyotoConverters.h" #include #include @@ -74,12 +75,18 @@ (*initfcn)(); } +#if defined GYOTO_USE_XERCES void Gyoto::Register::init(char const * cpluglist) { // Clean registers Metric::initRegister(); Astrobj::initRegister(); Spectrum::initRegister(); + // This cleans and fills Spectometer::Register_ + Spectrometer::initRegister(); + + // Init units system + Units::Init(); // Init built-in plug-ins #ifdef GYOTO_BUILTIN_STDPLUG @@ -134,31 +141,39 @@ Gyoto::SmartPointee::Subcontractor_t* -Register::Entry::getSubcontractor(std::string name) { +Register::Entry::getSubcontractor(std::string name, int errmode) { +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + GYOTO_DEBUG_EXPR(name); + GYOTO_DEBUG_EXPR(errmode); + GYOTO_ENDIF_DEBUG +# endif if (name_==name) return subcontractor_; - if (next_) return next_ -> getSubcontractor(name); + if (next_) return next_ -> getSubcontractor(name, errmode); + if (errmode) return NULL; throwError ("Unregistered kind: "+name); return NULL; // will never get there, avoid compilation warning } void Gyoto::Register::list() { Register::Entry* entry = NULL; + cout << "List of available Metrics:" << endl; - entry = Metric::Register_; - while (entry) { + for (entry = Metric::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; - entry = entry -> next_ ; - } cout << "List of available Astrobjs:" << endl; - entry = Astrobj::Register_; - while (entry) { + for (entry = Astrobj::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; - entry = entry -> next_ ; - } cout << "List of available Spectra:" << endl; for (entry = Spectrum::Register_; entry; entry = entry -> next_) cout << " " << entry -> name_ << endl; + + cout << "List of available Spectrometers:" << endl; + for (entry = Spectrometer::Register_; entry; entry = entry -> next_) + cout << " " << entry -> name_ << endl; + } +#endif diff -Nru gyoto-0.0.3/lib/RotStar3_1.C gyoto-0.1.0/lib/RotStar3_1.C --- gyoto-0.0.3/lib/RotStar3_1.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/RotStar3_1.C 2013-07-27 09:14:20.000000000 +0000 @@ -41,39 +41,27 @@ using namespace Gyoto; using namespace Gyoto::Metric; -RotStar3_1::RotStar3_1(const char * lorene_res, const int integ_kind) : +RotStar3_1::RotStar3_1() : Generic(GYOTO_COORDKIND_SPHERICAL), - integ_kind_(integ_kind) + filename_(NULL), + star_(NULL), + integ_kind_(1) { setKind("RotStar3_1"); - if (debug()) { - cout << "RotStar3_1 Construction" << endl; - cout << "Using integration kind: " ; - if (integ_kind_) { - cout << "3+1 specific" << endl; - }else{ - cout << "4D general" << endl; - } - cout << "Filename=" << lorene_res << endl; - } - filename_ = new char[strlen(lorene_res)+1]; - strcpy(filename_,lorene_res); - FILE* resfile=fopen(lorene_res,"r"); - if (!resfile) throwError(string("No such file or directory: ")+lorene_res); - Mg3d* mg = new Mg3d(resfile); - Map_et* mps = new Map_et(*mg,resfile); - Eos* p_eos = Eos::eos_from_file(resfile); - star_ = new Star_rot(*mps,*p_eos,resfile); - star_ -> equation_of_state(); - star_ -> update_metric(); - star_ -> hydro_euler(); - - //if (debug()) cout << "Map_et= " << *mps << endl; +} +RotStar3_1::RotStar3_1(const RotStar3_1& o) : + Generic(o), + filename_(NULL), + star_(NULL), + integ_kind_(o.integ_kind_) +{ + setKind("RotStar3_1"); + setFileName(o.getFileName()); } RotStar3_1* RotStar3_1::clone() const { - return new RotStar3_1(filename_, integ_kind_); + return new RotStar3_1(*this); } RotStar3_1::~RotStar3_1() @@ -90,7 +78,36 @@ if (debug()) cout << "RotStar3_1 Destruction" << endl; } -char const * const RotStar3_1::getFileName() const { return filename_; } + +void RotStar3_1::setFileName(char const * lorene_res) { + if (filename_) { delete[] filename_; filename_=NULL; } + if (star_) { + const Map& mp=star_ -> get_mp(); + const Mg3d* mg=mp.get_mg(); + const Map* mpp=∓ + delete star_; star_=NULL; + delete mpp; + delete mg; + } + + filename_ = new char[strlen(lorene_res)+1]; + strcpy(filename_,lorene_res); + FILE* resfile=fopen(lorene_res,"r"); + if (!resfile) throwError(string("No such file or directory: ")+lorene_res); + Mg3d* mg = new Mg3d(resfile); + Map_et* mps = new Map_et(*mg,resfile); + Eos* p_eos = Eos::eos_from_file(resfile); + star_ = new Star_rot(*mps,*p_eos,resfile); + star_ -> equation_of_state(); + star_ -> update_metric(); + star_ -> hydro_euler(); + + tellListeners(); +} + +char const * RotStar3_1::getFileName() const { return filename_; } + +void RotStar3_1::setIntegKind(int ik) { integ_kind_ = ik; } int RotStar3_1::getIntegKind() const { return integ_kind_; } int RotStar3_1::diff(const double coord[8], double res[8]) const @@ -569,7 +586,7 @@ double fact=.001;//allows changes of order 0.1% of original value (don't put it too big!! or the corrected rprime and thprime will depend a lot on the chosen nstep -- no convergence towards a given value when nstep grows...) int nstep=100;//nstep search steps on both sides of initial rdot (or thdot) value ; search interval between 2 trials = fact*[init value]/nstep = dr/nstep (or dth/nstep) - double dth=fabs(fact*thprime), dr=fabs(fact*rprime), newnorm, lastnorm=norminit, norm_new=norminit, rp, thp, intth=dth/double(nstep), intr=dr/double(nstep); + double dth=fabs(fact*thprime), dr=fabs(fact*rprime), newnorm, lastnorm=norminit, rp, thp, intth=dth/double(nstep), intr=dr/double(nstep); // cout << "Norm init= "< setParameter("File", filename_); fmp -> setParameter("IntegKind", integ_kind_); Generic::fillElement(fmp); } -Gyoto::SmartPointer -Gyoto::Metric::RotStar3_1::Subcontractor(FactoryMessenger* fmp) { - - //default values - //double mass=1.; - int integ_kind=1; - string filename=""; - - //tmp vars - string name="", content=""; - - while (fmp->getNextParameter(&name, &content)) { - if (name == "IntegKind") integ_kind = atoi(content.c_str()); - else if (name == "File") filename = fmp -> fullPath( content ); - } - - if (filename=="") throwError("File MUST be defined in RotStar3_1"); - - RotStar3_1* gg = new RotStar3_1(filename.c_str(),integ_kind); - gg -> processGenericParameters(fmp); - return gg; +void RotStar3_1::setParameter(string name, string content, string unit){ + if (name=="IntegKind") setIntegKind(atoi(content.c_str())); + else if (name == "File") setFileName(content.c_str()); + else Generic::setParameter(name, content, unit); } -void Gyoto::Metric::RotStar3_1::Init() { - Gyoto::Metric::Register("RotStar3_1", &Gyoto::Metric::RotStar3_1::Subcontractor); +void RotStar3_1::setParameters(FactoryMessenger* fmp) { + string name="", content="", unit=""; + if (fmp) { + while (fmp->getNextParameter(&name, &content, &unit)) { + if (name == "File") content = fmp -> fullPath( content ); + GYOTO_DEBUG << "Setting \"" << name << "\" to \"" << content + << "\" (in unit \"" << unit << "\")\n"; + setParameter(name, content, unit); + } + } } #endif diff -Nru gyoto-0.0.3/lib/Scenery.C gyoto-0.1.0/lib/Scenery.C --- gyoto-0.0.3/lib/Scenery.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Scenery.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard, Frederic Vincent + Copyright 2011, 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. @@ -27,7 +27,14 @@ #include #include -#define DEFAULT_TLIM 0. +#define DEFAULT_TMIN -DBL_MAX + +#ifdef HAVE_PTHREAD +#include +#endif + +#include /* for benchmarking */ + using namespace Gyoto; using namespace std; @@ -37,13 +44,28 @@ deltatau_(0.01) {} */ Scenery::Scenery() : - gg_(NULL), screen_(NULL), obj_(NULL), delta_(0.01), - quantities_(0), ph_(), tlim_(DEFAULT_TLIM) {} + gg_(NULL), screen_(NULL), obj_(NULL), delta_(GYOTO_DEFAULT_DELTA), + adaptive_(1), + quantities_(0), ph_(), tmin_(DEFAULT_TMIN), nthreads_(0), + maxiter_(GYOTO_DEFAULT_MAXITER){} + +Scenery::Scenery(SmartPointer met, + SmartPointer screen, + SmartPointer obj) : + gg_(met), screen_(screen), obj_(obj), delta_(GYOTO_DEFAULT_DELTA), + adaptive_(1), + quantities_(0), ph_(), tmin_(DEFAULT_TMIN), nthreads_(0), + maxiter_(GYOTO_DEFAULT_MAXITER) +{ + if (screen_) screen_->setMetric(gg_); + if (obj_) obj_->setMetric(gg_); +} Scenery::Scenery(const Scenery& o) : SmartPointee(o), - gg_(NULL), screen_(NULL), obj_(NULL), delta_(o.delta_), - quantities_(o.quantities_), ph_(o.ph_), tlim_(o.tlim_) + gg_(NULL), screen_(NULL), obj_(NULL), delta_(o.delta_), adaptive_(o.adaptive_), + quantities_(o.quantities_), ph_(o.ph_), tmin_(o.tmin_), nthreads_(o.nthreads_), + maxiter_(o.maxiter_) { // We have up to 3 _distinct_ clones of the same Metric. // Keep only one. @@ -64,26 +86,21 @@ deltatau_(0.01) {} */ -Scenery::Scenery(SmartPointer met, SmartPointer screen, SmartPointer obj) : - gg_(met), screen_(screen), obj_(obj), delta_(0.01), - quantities_(0) -{ - if (screen_) screen_->setMetric(gg_); - if (obj_) obj_->setMetric(gg_); -} Scenery::~Scenery() { - if (debug()) - cerr << "DEBUG: in Scenery::~Scenery()\n" - << "DEBUG: Scenery::~Scenery(): freeing metric\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "freeing metric\n"; +# endif gg_ = NULL; - if (debug()) - cerr << "DEBUG: Scenery::~Scenery(): freeing screen\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "freeing screen\n"; +# endif screen_ = NULL; - if (debug()) - cerr << "DEBUG: Scenery::~Scenery(): freeing astrobj\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "freeing astrobj\n"; +# endif obj_ = NULL; } @@ -110,88 +127,264 @@ } double Scenery::getDelta() const { return delta_; } +double Scenery::getDelta(const string &unit) const { + return Units::FromGeometrical(getDelta(), unit, gg_); +} + void Scenery::setDelta(double d) { delta_ = d; } +void Scenery::setDelta(double d, const string &unit) { + setDelta(Units::ToGeometrical(d, unit, gg_)); +} + +void Scenery::setNThreads(size_t n) { nthreads_ = n; } +size_t Scenery::getNThreads() const { return nthreads_; } + +typedef struct SceneryThreadWorkerArg { +#ifdef HAVE_PTHREAD + pthread_mutex_t * mutex; + pthread_t * parent; +#endif + size_t i, j, imin, imax, jmin, jmax; + Scenery *sc; + Photon * ph; + Astrobj::Properties *data; + double * impactcoords; +} SceneryThreadWorkerArg ; + +static void * SceneryThreadWorker (void *arg) { + /* + This is the real ray-tracing loop. It may be called by multiple + threads in parallel, launched from ::rayTrace + */ + + SceneryThreadWorkerArg *larg = static_cast(arg); + + // Each thread needs its own Photon, clone cached Photon + // it is assumed to be already initialized with spectrometer et al. + Photon * ph = larg -> ph; +#ifdef HAVE_PTHREAD + if (larg->mutex) { + pthread_mutex_lock(larg->mutex); + ph = larg -> ph -> clone(); + pthread_mutex_unlock(larg->mutex); + } +#endif + + // local variables to store our parameters + size_t i, j; + Astrobj::Properties data; + double * impactcoords = NULL; + + size_t count=0; + + while (1) { + /////// 1- get input and output parameters and update them for next access + //// i and j are input, data and impactcoords are where to store + //// output. we must get them and increase them so that another + //// thread can get the next values while we integrate. +#ifdef HAVE_PTHREAD + // lock mutex so we can safely read and update i, j et al. + if (larg->mutex) pthread_mutex_lock(larg->mutex); +#endif + // copy i & j + i = larg->i; j = larg->j; + if (j > larg->jmax || (j==larg->jmax && i>larg->imax)) { + // terminate, but first... +#ifdef HAVE_PTHREAD + // ...unlock mutex so our siblings can access i & j and terminate too + if (larg->mutex) pthread_mutex_unlock(larg->mutex); +#endif + break; + } + // update i & j + ++larg->i; + if (larg->i > larg->imax) { + ++larg->j; larg->i=larg->imin; + } + + // copy output pointers and update them + data = *larg->data; ++(*larg->data); + if (larg->impactcoords) { + impactcoords = larg->impactcoords; larg->impactcoords+=16; + } + +#ifdef HAVE_PTHREAD + // unlock mutex so our siblings can can access i, j et al. and procede + if (larg->mutex) pthread_mutex_unlock(larg->mutex); +#endif + + ////// 2- do the actual work. + if (i==larg->imin && verbose() >= GYOTO_QUIET_VERBOSITY && !impactcoords) { +# ifdef HAVE_PTHREAD + if (larg->mutex) pthread_mutex_lock(larg->mutex); +# endif + cout << "\rj = " << j << " / " << larg->jmax << " " << flush; +# ifdef HAVE_PTHREAD + if (larg->mutex) pthread_mutex_unlock(larg->mutex); +# endif + } +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "i = " << i << ", j = " << j << endl; +# endif + (*larg->sc)(i, j, &data, impactcoords, ph); + ++count; + } +#ifdef HAVE_PTHREAD + if (larg->mutex) { + delete ph; + pthread_mutex_lock(larg->mutex); + } + GYOTO_MSG << "\nThread terminating after integrating " << count << " photons"; + if (larg->mutex) pthread_mutex_unlock(larg->mutex); +# endif + return NULL; +} void Scenery::rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax, Astrobj::Properties *data, double * impactcoords) { - // if (debug()) cout << "screen dist beg ray trace= " << screen_ -> getDistance() << endl; + /* + Ray-trace now is multi-threaded. What it does is + - some initialization + - launch nthreads_ - 1 thread working on of SceneryThreadWorker + - call SceneryThreadWorker itself rather than sleeping + - wait for the other threads to be terminated + - some housekeeping + */ const size_t npix = screen_->getResolution(); - //ofstream pixels(filename);//illuminated pixels on screen - SmartPointer spr = screen_->getSpectrometer(); - ph_.setSpectrometer(spr); - size_t nbnuobs = spr() ? spr -> getNSamples() : 0; - ph_.setTlim(tlim_); - - double coord[8]; - + imax=(imax<=(npix)?imax:(npix)); + jmax=(jmax<=(npix)?jmax:(npix)); screen_->computeBaseVectors(); // Necessary for KS integration, computes relation between // observer's x,y,z coord and KS X,Y,Z coord. Will be used to // compute photon's initial tangent vector. // Note : this is a BUG if this is required, should be done automagically. - imax=(imax<=(npix)?imax:(npix)); - jmax=(jmax<=(npix)?jmax:(npix)); + /// initialize photon once. It will be cloned. + SmartPointer spr = screen_->getSpectrometer(); + ph_.setSpectrometer(spr); + ph_.setTmin(tmin_); + ph_.setFreqObs(screen_->getFreqObs()); + double coord[8]; + screen_ -> getRayCoord(imin,jmin, coord); + ph_ . setInitialCondition(gg_, obj_, coord); + ph_ . adaptive(adaptive_); + ph_ . maxiter(maxiter_); + // delta is reset in operator() + + if (data) setPropertyConverters(data); + + SceneryThreadWorkerArg larg; + larg.sc=this; + larg.ph=&ph_; + larg.data=data; + larg.impactcoords=impactcoords; + larg.i=imin; + larg.j=jmin; + larg.imin=imin; + larg.imax=imax; + larg.jmin=jmin; + larg.jmax=jmax; + + struct timeval tim; + double start, end; + gettimeofday(&tim, NULL); + start=double(tim.tv_sec)+(double(tim.tv_usec)/1000000.0); + +#ifdef HAVE_PTHREAD + larg.mutex = NULL; + pthread_mutex_t mumu = PTHREAD_MUTEX_INITIALIZER; + pthread_t * threads = NULL; + pthread_t pself = pthread_self(); + larg.parent = &pself; + if (nthreads_ >= 2) { + threads = new pthread_t[nthreads_-1]; + larg.mutex = &mumu; + for (size_t th=0; th < nthreads_-1; ++th) { + if (pthread_create(threads+th, NULL, + SceneryThreadWorker, static_cast(&larg)) < 0) + throwError("Error creating thread"); + } + } +#endif - for (size_t j=jmin;j<=jmax;j++) { + // Call worker on the parent thread + (*SceneryThreadWorker)(static_cast(&larg)); - if (verbose() >= GYOTO_QUIET_VERBOSITY && !impactcoords) - cout << "\rj = " << j << " / " << jmax << " " << flush; - for (size_t i=imin;i<=imax;i++) { - ph_.setDelta(delta_); +#ifdef HAVE_PTHREAD + // Wait for the child threads + if (nthreads_>=2) + for (size_t th=0; th < nthreads_-1; ++th) + pthread_join(threads[th], NULL); +#endif - if (debug()) - cerr << "DEBUG: Scenery::rayTrace(): i = " << i - << ", j = " << j << endl; - - data -> init(nbnuobs); // Initialize requested quantities to 0. or DBL_MAX - - if (impactcoords) { - if (impactcoords[0] != DBL_MAX) { - ph_.setInitialCondition(gg_, obj_, impactcoords+8); - ph_.resetTransmission(); - obj_ -> processHitQuantities(&ph_, - impactcoords+8,impactcoords,0.,data); - } - } else { - screen_ -> getRayCoord(i,j, coord); - ph_.setInitialCondition(gg_, obj_, coord); - ph_.hit(data); - } + gettimeofday(&tim, NULL); + end=double(tim.tv_sec)+(double(tim.tv_usec)/1000000.0); - if (data) ++(*data); // operator++ is overloaded - if (impactcoords) impactcoords += 16 ; + GYOTO_MSG << "\nRaytraced "<< (jmax-jmin+1) * (imax-imin+1) + << " photons in " << end-start + << "s using " << nthreads_ << " thread(s)\n"; - } - } } -void Scenery::operator() (size_t i, size_t j, - Astrobj::Properties *data, double * impactcoords) { +void Scenery::operator() ( + size_t i, size_t j, + Astrobj::Properties *data, double * impactcoords, + Photon *ph + ) { double coord[8]; - SmartPointer spr = screen_->getSpectrometer(); - ph_.setSpectrometer(spr); + SmartPointer spr = screen_->getSpectrometer(); size_t nbnuobs = spr() ? spr -> getNSamples() : 0; - ph_.setDelta(delta_); - ph_.setTlim(tlim_); - - if (data) data -> init(nbnuobs); + SmartPointer gg = NULL; + SmartPointer obj = NULL; + if (!ph) { + // if Photon was passed, assume it was initiliazed already. Don't + // touch its metric and astrobj. Else, update cached photon. Photon + // is passed in particular when called in a multi-threaded + // environment: it may really need to work on a given copy of the object. + ph = &ph_; + ph -> setSpectrometer(spr); + ph -> setTmin(tmin_); + ph -> setFreqObs(screen_->getFreqObs()); + ph -> adaptive(adaptive_); + ph -> maxiter(maxiter_); + obj=obj_; + gg=gg_; + } + // Always reset delta +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "reset delta" << endl; +# endif + ph -> setDelta(delta_); + ph -> adaptive(adaptive_); + ph -> maxiter(maxiter_); + ph -> setTmin(tmin_); + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "init nbnuobs" << endl; +# endif + if (data) data -> init(nbnuobs); // Initialize requested quantities to 0. or DBL_MAX if (impactcoords) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "impactcoords set" << endl; +# endif if(impactcoords[0] != DBL_MAX) { - ph_.setInitialCondition(gg_, obj_, impactcoords+8); - ph_.resetTransmission(); - obj_ -> processHitQuantities(&ph_,impactcoords+8,impactcoords,0.,data); + ph -> setInitialCondition(gg, obj, impactcoords+8); + ph -> resetTransmission(); + obj_ -> processHitQuantities(ph,impactcoords+8,impactcoords,0.,data); } } else { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "impactcoords not set" << endl; +# endif screen_ -> getRayCoord(i,j, coord); - ph_.setInitialCondition(gg_, obj_, coord); - ph_.hit(data); + ph -> setInitialCondition(gg, obj, coord); + ph -> hit(data); } } @@ -200,10 +393,33 @@ void Scenery::setRequestedQuantities(std::string squant) { quantities_=0; char * tk = strtok(const_cast(squant.c_str()), " \t\n"); + string tkk="", quant="", unit = ""; + size_t first = 0, last = 0; + +# ifdef HAVE_UDUNITS + if (screen_) screen_ -> mapPixUnit(); +# endif + while (tk != NULL) { - if (!strcmp(tk, "Intensity")) + tkk = tk; + first = tkk.find("["); + last = tkk.size() - 1; + if (first < last) { + unit = tkk.substr(first+1, last-first-1); + quant = tkk.substr(0, first); + } else { + unit=""; + quant=tkk; + } +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "quant=" << quant << ", unit=" << unit << "." << endl; +# endif + tk=const_cast(quant.c_str()); + + if (!strcmp(tk, "Intensity")) { quantities_ |= GYOTO_QUANTITY_INTENSITY; - else if (!strcmp(tk, "EmissionTime")) + setIntensityConverter(unit); + } else if (!strcmp(tk, "EmissionTime")) quantities_ |= GYOTO_QUANTITY_EMISSIONTIME; else if (!strcmp(tk, "MinDistance")) quantities_ |= GYOTO_QUANTITY_MIN_DISTANCE; @@ -213,11 +429,13 @@ quantities_ |= GYOTO_QUANTITY_REDSHIFT; else if (!strcmp(tk, "ImpactCoords")) quantities_ |= GYOTO_QUANTITY_IMPACTCOORDS; - else if (!strcmp(tk, "Spectrum")) + else if (!strcmp(tk, "Spectrum")) { quantities_ |= GYOTO_QUANTITY_SPECTRUM; - else if (!strcmp(tk, "BinSpectrum")) + setSpectrumConverter(unit); + } else if (!strcmp(tk, "BinSpectrum")) { quantities_ |= GYOTO_QUANTITY_BINSPECTRUM; - else if (!strcmp(tk, "User1")) + setBinSpectrumConverter(unit); + } else if (!strcmp(tk, "User1")) quantities_ |= GYOTO_QUANTITY_USER1; else if (!strcmp(tk, "User2")) quantities_ |= GYOTO_QUANTITY_USER2; @@ -227,17 +445,69 @@ quantities_ |= GYOTO_QUANTITY_USER4; else if (!strcmp(tk, "User5")) quantities_ |= GYOTO_QUANTITY_USER5; - else throwError("ScenerySubcontractor(): unkwon quantity"); + else throwError("ScenerySubcontractor(): unknown quantity"); tk = strtok(NULL, " \t\n"); } - if (debug()) - cerr << "DEBUG: Scenery::setRequestedQuantities("< setIntensityConverter(intensity_converter_); + data -> setSpectrumConverter(spectrum_converter_); + data -> setBinSpectrumConverter(binspectrum_converter_); +# endif +} + +void Scenery::setSpectrumConverter(string unit) { +# ifdef HAVE_UDUNITS + // default is SI + if (unit=="") unit="J.m-2.s-1.sr-1.Hz-1"; + spectrum_converter_ = new Units::Converter("J.m-2.s-1.sr-1.Hz-1", unit); +# else + if (unit!="") + GYOTO_WARNING + << "Unit ignored, please recompile gyoto with --with-udunits" + << endl; +# endif +} + +void Scenery::setBinSpectrumConverter(string unit) { +# ifdef HAVE_UDUNITS + // default is SI + if (unit=="") unit="J.m-2.s-1.sr-1"; + binspectrum_converter_ = new Units::Converter("J.m-2.s-1.sr-1", unit); +# else + if (unit!="") + GYOTO_WARNING + << "Unit ignored, please recompile gyoto with --with-udunits" + << endl; +# endif +} + std::string Scenery::getRequestedQuantitiesString() const { string squant = ""; Quantity_t quantities @@ -280,55 +550,94 @@ return nquant; } -double Scenery::getTlim() const { return tlim_; } -void Scenery::setTlim(double tlim) { tlim_ = tlim; } +double Scenery::getTmin() const { return tmin_; } +double Scenery::getTmin(const string &unit) const { + return Units::FromGeometricalTime(getTmin(), unit, gg_); +} + +void Scenery::setTmin(double tmin) { tmin_ = tmin; } +void Scenery::setTmin(double tmin, const string &unit) { + setTmin(Units::ToGeometricalTime(tmin, unit, gg_)); +} + +void Scenery::adaptive(bool mode) { adaptive_ = mode; } +bool Scenery::adaptive() const { return adaptive_; } + +void Scenery::maxiter(size_t miter) { maxiter_ = miter; } +size_t Scenery::maxiter() const { return maxiter_; } #ifdef GYOTO_USE_XERCES void Scenery::fillElement(FactoryMessenger *fmp) { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "fmp -> setMetric (gg_) ;" << endl; +# endif if (gg_) fmp -> setMetric (gg_) ; + +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setScreen (screen_) ;" << endl; +# endif if (screen_) fmp -> setScreen (screen_) ; + +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setAstrobj (obj_) ;" << endl; +# endif if (obj_) fmp -> setAstrobj (obj_) ; + if (delta_ != GYOTO_DEFAULT_DELTA) { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setParameter (\"Delta\", "< setParameter ("Delta", delta_); } + + if (!adaptive()) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG <<"fmp -> setParameter (\"NonAdaptive\") ;" << endl; +# endif + fmp -> setParameter ("NonAdaptive"); + } + + if (maxiter_ != GYOTO_DEFAULT_MAXITER) + fmp -> setParameter("MaxIter", maxiter_); + if (getRequestedQuantities()) { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG <<"fmp -> setParameter (\"Quantities\", \"" < setParameter("Quantities", getRequestedQuantitiesString()); } - if (tlim_ != DEFAULT_TLIM) fmp -> setParameter("MinimumTime", tlim_); + + if (tmin_ != DEFAULT_TMIN) fmp -> setParameter("MinimumTime", tmin_); + if (nthreads_) fmp -> setParameter("NThreads", nthreads_); } -SmartPointer Gyoto::ScenerySubcontractor(FactoryMessenger* fmp) { +SmartPointer Gyoto::Scenery::Subcontractor(FactoryMessenger* fmp) { - string name="", content=""; - double delta = GYOTO_DEFAULT_DELTA ; + string name="", content="", unit=""; SmartPointer gg = NULL; SmartPointer scr = NULL; SmartPointer ao = NULL; string squant = ""; - double tlim = DEFAULT_TLIM; gg = fmp->getMetric(); scr= fmp->getScreen(); ao = fmp->getAstrobj(); + SmartPointer sc = new Scenery(gg, scr, ao); - while (fmp->getNextParameter(&name, &content)) { + while (fmp->getNextParameter(&name, &content, &unit)) { char* tc = const_cast(content.c_str()); - if (name=="Delta") delta = atof(tc); - if (name=="Quantities") squant = content; - if (name=="TLim") tlim = atof(tc); + if (name=="Delta") sc -> setDelta(atof(tc), unit);; + if (name=="Quantities") sc -> setRequestedQuantities(tc); + if (name=="MinimumTime") sc -> setTmin(atof(tc), unit); + if (name=="NThreads") sc -> setNThreads(atoi(tc)); + if (name=="MaxIter") sc -> maxiter(atoi(tc)); + if (name=="Adaptive") sc -> adaptive(true); + if (name=="NonAdaptive") sc -> adaptive(false); + } - SmartPointer sc = new Scenery(gg, scr, ao); - sc -> setDelta(delta); - sc -> setTlim(tlim); - if (squant!="") sc -> setRequestedQuantities(squant); return sc; } #endif diff -Nru gyoto-0.0.3/lib/Screen.C gyoto-0.1.0/lib/Screen.C --- gyoto-0.0.3/lib/Screen.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Screen.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard, Frederic Vincent + Copyright 2011, 2013 Thibaut Paumard, Frederic Vincent This file is part of Gyoto. @@ -20,6 +20,7 @@ #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" #include "GyotoScreen.h" +#include "GyotoConverters.h" #include #include @@ -34,18 +35,30 @@ Screen::Screen() : //tobs_(0.), fov_(M_PI*0.1), tmin_(0.), npix_(1001), tobs_(0.), fov_(M_PI*0.1), npix_(1001), - distance_(1.), dmax_(GYOTO_SCREEN_DMAX), gg_(NULL), spectro_(NULL) + alpha0_(0.), delta0_(0.), + anglekind_(0), + distance_(1.), dmax_(GYOTO_SCREEN_DMAX), gg_(NULL), spectro_(NULL), + freq_obs_(1.) { - if (debug()) cerr << "DEBUG: Screen::Screen()" << endl ; - if (debug()) cerr << "DEBUG: Screen::dmax_ = " << dmax_ << endl ; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(dmax_); +# endif euler_[0]=euler_[1]=euler_[2]=0.; setProjection(0., 0., 0.); + for (int ii=0;ii<4;ii++) { + fourvel_[ii]=0.; + screen1_[ii]=0.; + screen2_[ii]=0.; + screen3_[ii]=0.; + } } Screen::Screen(const Screen& o) : SmartPointee(o), tobs_(o.tobs_), fov_(o.fov_), npix_(o.npix_), distance_(o.distance_), - dmax_(o.dmax_), gg_(NULL), spectro_(NULL) + alpha0_(o.alpha0_), delta0_(o.delta0_), + anglekind_(o.anglekind_), + dmax_(o.dmax_), gg_(NULL), spectro_(NULL), freq_obs_(o.freq_obs_) { if (o.gg_()) gg_=o.gg_->clone(); if (o.spectro_()) spectro_ = o.spectro_ -> clone(); @@ -56,6 +69,12 @@ ey_[i]=o.ey_[i]; ez_[i]=o.ez_[i]; } + for (int ii=0;ii<4;ii++) { + fourvel_[ii]=o.fourvel_[ii]; + screen1_[ii]=o.screen1_[ii]; + screen2_[ii]=o.screen2_[ii]; + screen3_[ii]=o.screen3_[ii]; + } } Screen * Screen::clone() const { return new Screen(*this); } @@ -65,7 +84,7 @@ o << "distance=" << distance_ << ", " ; o << "paln=" << euler_[0] << ", " ; o << "inclination=" << euler_[1] << ", " ; - o << "argument=" << euler_[2] ; + o << "argument=" << euler_[2] << "." << endl; return o; } @@ -89,21 +108,7 @@ } void Screen::setDistance(double dist, const string unit) { - if ((unit=="") || (unit=="m")) ; // default is SI - else if (unit=="geometrical") dist *= gg_ -> unitLength(); - else if (unit=="cm") dist *= 1e-2; - else if (unit=="km") dist *= 1e3; - else if (unit=="sunradius") dist *= GYOTO_SUN_RADIUS; - else if ((unit=="astronomicalunit") || - (unit=="AU") || - (unit=="au") || - (unit=="ua")) - dist *= GYOTO_ASTRONOMICAL_UNIT; - else if (unit=="ly") dist *= GYOTO_LIGHT_YEAR; - else if (unit=="pc") dist *= GYOTO_KPC * 1e-3; - else if (unit=="kpc") dist *= GYOTO_KPC; - else if (unit=="Mpc") dist *= GYOTO_KPC * 1e3; - setDistance(dist); + setDistance(Units::ToMeters(dist, unit, gg_)); } void Screen::setDistance(double dist) { distance_=dist; @@ -111,15 +116,21 @@ } void Screen::setDmax(double dist) { - if (debug()) cerr << "DEBUG: Screen::setDmax("< gg) { gg_ = gg; computeBaseVectors(); } int Screen::getCoordKind() const { return gg_ -> getCoordKind(); } double Screen::getDistance() const { return distance_; } +double Screen::getDistance(const std::string& unit) const { + return Units::FromMeters(getDistance(), unit, gg_); +} double Screen::getPALN() const { return euler_[0]; } +double Screen::getPALN(const string &unit) const { + double paln = getPALN(); + if (unit != "" && unit != "rad" ) { +# ifdef HAVE_UDUNITS + paln = Units::Converter(unit, "rad")(paln); +#else + GYOTO_WARNING << "unit ignored, please recompile with --with-udunits\n"; +#endif + } + return paln; +} + double Screen::getInclination() const { return euler_[1]; } +double Screen::getInclination(const string &unit) const { + double incl = getInclination(); + if (unit != "" && unit != "rad" ) { +# ifdef HAVE_UDUNITS + incl = Units::Converter(unit, "rad")(incl); +#else + GYOTO_WARNING << "unit ignored, please recompile with --with-udunits\n"; +#endif + } + return incl; +} + double Screen::getArgument() const { return euler_[2]; } +double Screen::getArgument(const string &unit) const { + double arg = getArgument(); + if (unit != "" && unit != "rad" ) { +# ifdef HAVE_UDUNITS + arg = Units::Converter(unit, "rad")(arg); +#else + GYOTO_WARNING << "unit ignored, please recompile with --with-udunits\n"; +#endif + } + return arg; +} + SmartPointer Screen::getMetric() const { return gg_; } void Screen::setObserverPos(const double coord[4]) { @@ -184,6 +257,26 @@ computeBaseVectors(); } +void Screen::setFourVel(const double coord[4]) { + for (int ii=0;ii<4;ii++) + fourvel_[ii]=coord[ii]; +} + +void Screen::setScreen1(const double coord[4]) { + for (int ii=0;ii<4;ii++) + screen1_[ii]=coord[ii]; +} + +void Screen::setScreen2(const double coord[4]) { + for (int ii=0;ii<4;ii++) + screen2_[ii]=coord[ii]; +} + +void Screen::setScreen3(const double coord[4]) { + for (int ii=0;ii<4;ii++) + screen3_[ii]=coord[ii]; +} + void Screen::getObserverPos(double coord[]) const { double r0 = distance_ / gg_ -> unitLength(); @@ -218,29 +311,68 @@ } } +void Screen::getFourVel(double fourvel[]) const{ + for (int ii=0;ii<4;ii++) fourvel[ii]=fourvel_[ii]; +} + +void Screen::getScreen1(double output[]) const{ + for (int ii=0;ii<4;ii++) output[ii]=screen1_[ii]; +} + +void Screen::getScreen2(double output[]) const{ + for (int ii=0;ii<4;ii++) output[ii]=screen2_[ii]; +} + +void Screen::getScreen3(double output[]) const{ + for (int ii=0;ii<4;ii++) output[ii]=screen3_[ii]; +} + /* SPECTROMETER */ -void Screen::setSpectrometer(SmartPointer spr) { spectro_=spr; } -SmartPointer Screen::getSpectrometer() const { return spectro_; } +void Screen::setSpectrometer(SmartPointer spr) { spectro_=spr; } +SmartPointer Screen::getSpectrometer() const { return spectro_; } void Screen::getRayCoord(const size_t i, const size_t j, double coord[]) const { - const double delta= fov_/npix_; + const double delta= fov_/double(npix_); double xscr, yscr; - if (debug()) cerr << "Gyoto::Screen::getRayCoord(i=" << i - << ", j=" << j << ", coord)" << endl; - yscr=delta*(j-(npix_+1)/2.); - xscr=delta*(i-(npix_+1)/2.); - getRayCoord(-xscr, yscr, coord); +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "(i=" << i << ", j=" << j << ", coord)" << endl; +# endif + if (anglekind_){ + /* + GYOTO screen labelled by spherical + angles a and b (see Fig. in user guide) + */ + xscr = double(i-1)*fov_/(2.*double(npix_-1)); + yscr = double(j-1)*2.*M_PI/double(npix_-1); + getRayCoord(xscr, yscr, coord); + // NB: there will be also a X->-X transformation needed, + // that must be done when plotting the image + }else{ + /* + GYOTO screen labelled by equatorial + angles alpha and delta (see Fig. in user guide) + */ + yscr=delta*(double(j)-double(npix_+1)/2.); + xscr=delta*(double(i)-double(npix_+1)/2.); + getRayCoord(-xscr, yscr, coord); + // transforming X->-X (X being coord along e_1 observer vector) + // this is due to the orientation convention of the screen + // (cf InitialConditions.pdf) + } } void Screen::getRayCoord(double alpha, double delta, double coord[]) const { - //if (debug()) cout << "alpha,delta= " << alpha << " " << delta << endl; + alpha+=alpha0_; delta+=delta0_; // Screen orientation + int i; // dimension : 0, 1, 2 double pos[4]; - if (debug()) cerr << "getRayCoord(alpha="< dmax_) { @@ -254,99 +386,206 @@ coord[4]=coord[5]=coord[6]=coord[7]=0.;//initializing 4-velocity - //3-vector of norm unity directing the photon trajectory + double spherical_angle_a, + spherical_angle_b; - //NB: spherical_angles = spherical angles associated to the - //cartesian frame centered on the observer's screen, - //x=East,y=North,z=line-of-sight ; number 1 is from z-axis to - //vector, number 2 from x axis to projection on x-y plane. See notes - //for details. - - //NBB: for spherical_angle_1, the relation comes from the spherical - //law of cosines of spherical trigonometry, the arcs - //spherical_angle_1, alpha and delta forming a spherical triangle, - //with alpha othogonal to delta. - double spherical_angle_1 = acos(cos(alpha)*cos(delta)); - double spherical_angle_2 = (alpha==0. && delta==0.) ? 0. : atan2(delta,alpha); - // C++ atan2 seems to behave badly if the two arguments are 0 + if (anglekind_){ + /* + GYOTO screen labelled by spherical + angles a and b (see Fig. in user guide) + */ + + spherical_angle_a = alpha; + spherical_angle_b = delta; + }else{ + /* + GYOTO screen labelled by equatorial + angles alpha and delta (see Fig. in user guide) + Must compute spherical angles a and b + from these. + */ + + /* + NB: spherical_angles = spherical angles associated with the + orthonormal 3-frame of the observer's local rest space + */ + + /* + NBB: for spherical_angle_a, the relation comes from the spherical + law of cosines of spherical trigonometry, the arcs + spherical_angle_a, alpha and delta forming a spherical triangle, + with alpha othogonal to delta. + NBBB: for spherical_angle_b, the relation also comes from the spherical + law of cosine. + --> Following transformations are OK even for non-small alpha, delta + */ + + spherical_angle_a = acos(cos(alpha)*cos(delta)); + spherical_angle_b = + (alpha==0. && delta==0.) ? 0. : atan2(tan(delta),sin(alpha)); + } + + // Move these two angles to [0,pi], [0,2pi] + double s1tmp=spherical_angle_a, s2tmp=spherical_angle_b; + while (s1tmp>M_PI) s1tmp-=2.*M_PI; + while (s1tmp<-M_PI) s1tmp+=2.*M_PI;//then s1 in [-pi,pi] + if (s1tmp<0.) { + s1tmp=-s1tmp;//then s1 in [0,pi] + s2tmp+=M_PI;//thus, same direction + } + while (s2tmp>=2.*M_PI) s2tmp-=2.*M_PI; + while (s2tmp<0.) s2tmp+=2.*M_PI;//then s2 in [0,2pi[ + spherical_angle_a=s1tmp; + spherical_angle_b=s2tmp; + + /* + Tangent vector of incident photon in observer's local frame + vel is thus orthogonal to observer's 4-velocity + vel = vel[0]*screen1_+vel[1]*screen2_+vel[2]*screen3_ + where screen1,2,3_ is a triad in observer's rest space + */ - //NB: minus signs because the photon doesn't leave the screen, but + //NB: following minus signs because the photon doesn't leave the screen, but //is heading towards it! - double vel[3]={-sin(spherical_angle_1)*cos(spherical_angle_2), - -sin(spherical_angle_1)*sin(spherical_angle_2), - -cos(spherical_angle_1)}; - - switch (gg_ -> getCoordKind()) { - case GYOTO_COORDKIND_CARTESIAN: - { - //3 velocity normalization (see manual for details) - pos[0]=coord[0];pos[1]=coord[1];pos[2]=coord[2];pos[3]=coord[3]; - double gxx=gg_->gmunu(pos,1,1), gyy=gg_->gmunu(pos,2,2), gzz=gg_->gmunu(pos,3,3), gxy=gg_->gmunu(pos,1,2), gxz=gg_->gmunu(pos,1,3), gyz=gg_->gmunu(pos,2,3); - - //Transforming to KS: - for (i=0;i<3;++i) { - coord[5]+=vel[i]*ex_[i];//xdot0 - coord[6]+=vel[i]*ey_[i];//ydot0 - coord[7]+=vel[i]*ez_[i];//zdot0 + double vel[3]={-sin(spherical_angle_a)*cos(spherical_angle_b), + -sin(spherical_angle_a)*sin(spherical_angle_b), + -cos(spherical_angle_a)}; + + // 4-vector tangent to photon geodesic + + if (fourvel_[0]==0.){ + /* + ---> Observer local frame not given in XML <--- + Assume observer static at infinity ("standard Gyoto") + Treatment depending on coordinate system + */ + switch (gg_ -> getCoordKind()) { + case GYOTO_COORDKIND_CARTESIAN: + { + double rr=coord[1]*coord[1]+ + coord[2]*coord[2]+ + coord[3]*coord[3], + rinf=20.; // this rinf is just a very crude test + // I take rinf=10*rhor in Sch metric + if (rrgmunu(pos,1,1), + gthth=gg_->gmunu(pos,2,2), gphph=gg_->gmunu(pos,3,3); + coord[5]=-vel[2]/sqrt(grr); + double sp=sin(euler_[0]); + double cp=cos(euler_[0]); + coord[6]=(-sp*vel[0]+cp*vel[1])/sqrt(gthth); + coord[7]=( cp*vel[0]+sp*vel[1])/sqrt(gphph); } - coord[5]*=lambda;coord[6]*=lambda;coord[7]*=lambda; + break; + default: + throwError("Incompatible coordinate kind in Screen::getRayCoord()"); + break; } - break; - case GYOTO_COORDKIND_SPHERICAL: - { - pos[0]=coord[0];pos[1]=coord[1];pos[2]=coord[2];pos[3]=coord[3]; - double grr=gg_->gmunu(pos,1,1), gthth=gg_->gmunu(pos,2,2), gphph=gg_->gmunu(pos,3,3); - coord[5]=-vel[2]; - //coord[5]=-vel[2]/sqrt(grr); - double sp=sin(euler_[0]); - double cp=cos(euler_[0]); - coord[6]=(-sp*vel[0]+cp*vel[1])/coord[1]; - //coord[6]=(-sp*vel[0]+cp*vel[1])/sqrt(gthth); - coord[7]=( cp*vel[0]+sp*vel[1])/(coord[1]*sin(coord[2])); - //coord[7]=( cp*vel[0]+sp*vel[1])/sqrt(gphph); - - //Normalization of Boyer-Lindquist projected velocity to 1 (see manual for details). This is a choice of normalization for the photon tangent vector (i.e. 4-momentum) that boils down to taking observed frequency = 1. - - double lambda; - double nuobs=1.; - - if (grr*coord[5]*coord[5] + gthth*coord[6]*coord[6] + gphph*coord[7]*coord[7] < 0.){ - throwError("In Screen.C: impossible normalization!"); - }else{ - lambda=nuobs/sqrt(grr*coord[5]*coord[5] + gthth*coord[6]*coord[6] + gphph*coord[7]*coord[7]); - } - coord[5]*=lambda;coord[6]*=lambda;coord[7]*=lambda; + + // 0-component of photon tangent 4-vector found by normalizing + gg_ -> nullifyCoord(coord); + + }else{ + /* + ---> Observer local frame given in XML <--- + Express photon tangent 4-vector in the observer basis + Treatment is coordinate independent + (except for z-axis check right below) + */ + + if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ + if (coord[2]==0. || coord[2]==M_PI) + throwError("Please move Screen away from z-axis"); } - break; - default: - throwError("Incompatible coordinate kind in Screen::getRayCoord()"); - break; + + //Check orthonormal basis + double normtol=1e-10; + if (fabs(gg_->ScalarProd(coord,fourvel_,fourvel_)+1.)>normtol || + fabs(gg_->ScalarProd(coord,screen1_,screen1_)-1.)>normtol || + fabs(gg_->ScalarProd(coord,screen2_,screen2_)-1.)>normtol || + fabs(gg_->ScalarProd(coord,screen3_,screen3_)-1.)>normtol){ + throwError("In Screen:getRayCoord: observer's local" + " basis is not properly normalized"); + } + + if (fabs(gg_->ScalarProd(coord,fourvel_,screen1_))>normtol || + fabs(gg_->ScalarProd(coord,fourvel_,screen2_))>normtol || + fabs(gg_->ScalarProd(coord,fourvel_,screen3_))>normtol || + fabs(gg_->ScalarProd(coord,screen1_,screen2_))>normtol || + fabs(gg_->ScalarProd(coord,screen1_,screen3_))>normtol || + fabs(gg_->ScalarProd(coord,screen2_,screen3_))>normtol) + throwError("In Screen:getRayCoord: observer's local" + " basis is not orthogonal"); + + /* Photon tagent 4-vector l defined by: l = p + fourvel_ + where p gives the direction of the photon + in the observer's rest space (orthogonal to fourvel). + Here we choose the particular tangent 4-vector l + that satisfies l.fourvel_=-1 + Then l = fourvel_ + (orthogonal proj of l onto rest space) + = fourvel_ + p + and p = vel[0]*screen1_ + vel[1]*screen2_ + vel[2]*screen3_ + with p.p = 1, thus l.l = 0 as it should + */ + coord[4]=vel[0]*screen1_[0] + +vel[1]*screen2_[0] + +vel[2]*screen3_[0] + +fourvel_[0]; + coord[5]=vel[0]*screen1_[1] + +vel[1]*screen2_[1] + +vel[2]*screen3_[1] + +fourvel_[1]; + coord[6]=vel[0]*screen1_[2] + +vel[1]*screen2_[2] + +vel[2]*screen3_[2] + +fourvel_[2]; + coord[7]=vel[0]*screen1_[3] + +vel[1]*screen2_[3] + +vel[2]*screen3_[3] + +fourvel_[3]; + if (fabs(gg_->ScalarProd(coord,coord+4,coord+4))>normtol){ + throwError("In Screen::getRayCoord: " + " tangent 4-vector to photon not properly normalized"); + } + } - - // 3-vel [dx1/dlambda,dx2/dlambda,dx3/dlambda] -> 4-vel - gg_ -> nullifyCoord(coord); + } void Screen::computeBaseVectors() { // See http://en.wikipedia.org/wiki/Euler_angles // if (debug()) cout << "In compute base vectore" << endl; - double ca = cos(euler_[0]); // paln - double sa = sin(euler_[0]); - double cb = cos(euler_[1]); // inclination - double sb = sin(euler_[1]); - double cc = cos(euler_[2]); // argument - double sc = sin(euler_[2]); + double ca, sa; sincos(euler_[0], &sa, &ca); // paln + double cb, sb; sincos(euler_[1], &sb, &cb); // inclination + double cc, sc; sincos(euler_[2], &sc, &cc); // argument double unit = 1.;//1./distance_; //NB: here x,y,z are KS coordinates @@ -411,53 +650,138 @@ } double Screen::getTime() { return tobs_ ; } +double Screen::getTime(const string &unit) { + return Units::FromSeconds(getTime(), unit, gg_) ; +} void Screen::setTime(double tobs, const string &unit) { - if (unit=="" || unit=="s") ; - else if (unit=="geometrical") tobs *= gg_ -> unitLength() / GYOTO_C ; - else if (unit=="min") tobs *= 60. ; - else if (unit=="h") tobs *= 3600. ; - else if (unit=="d") tobs *= 86400. ; - else if (unit=="y") tobs *= 3.15576e+07; - else { - stringstream ss; - ss << "Screen::setTime(): unkwon unit \"" << unit << "\". Accepted units: " - << "[s] geometrical min h d y"; - throwError (ss.str()); - } - setTime(tobs); +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(tobs); + GYOTO_DEBUG_EXPR(unit); +# endif + setTime(Units::ToSeconds(tobs, unit, gg_)); +} +void Screen::setTime(double tobs) { + tobs_ = tobs; +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(tobs_); +# endif } -void Screen::setTime(double tobs) { tobs_ = tobs; } //double Screen::getMinimumTime() { return tmin_; } //void Screen::setMinimumTime(double tmin) { tmin_ = tmin; } double Screen::getFieldOfView() { return fov_; } +double Screen::getFieldOfView(string unit) { + double fov = getFieldOfView(); + if (unit=="" || unit=="rad") ; + else if (unit=="geometrical") fov *= distance_ / gg_ -> unitLength(); +# ifdef HAVE_UDUNITS + else if (Units::areConvertible(unit, "m")) + fov = Units::FromMeters(fov*distance_, unit) ; + else fov = Units::Converter("rad", unit)(fov); +# else + else if (unit=="degree") fov /= GYOTO_DEGRAD; + else if (unit=="arcmin") fov /= GYOTO_MINRAD; + else if (unit=="arcsec") fov /= GYOTO_SECRAD; + else if (unit=="milliarcsec") fov /= GYOTO_MASRAD; + else if (unit=="microarcsec") fov /= GYOTO_MUASRAD; + else { + stringstream ss; + ss << "Screen::setFieldOfView(): unknown unit: \"" << unit << "\"" + << " (you may have more chance compiling gyoto with --with-udunits)"; + throwError(ss.str()); + } +# endif + return fov; +} + void Screen::setFieldOfView(double fov, const string &unit) { if (unit=="" || unit=="rad") ; - else if (unit=="deg") fov *= GYOTO_DEGRAD; - else if (unit=="arcmin") fov *= GYOTO_MINRAD; - else if (unit=="arcsec") fov *= GYOTO_SECRAD; - else if (unit=="mas") fov *= GYOTO_MASRAD; - else if (unit=="µas" || unit=="uas") fov *= GYOTO_MUASRAD; + else if (unit=="geometrical") fov *= gg_ -> unitLength() / distance_ ; +# ifdef HAVE_UDUNITS + else { + Units::Unit from (unit); + if (Units::areConvertible(from, "m")) + fov = Units::ToMeters(fov, from) / distance_; + else fov = Units::Converter(from, "rad")(fov); + } +# else + else if (unit=="degree" || unit=="°") fov *= GYOTO_DEGRAD; + else if (unit=="arcmin") fov *= GYOTO_MINRAD; + else if (unit=="arcsec" || unit=="as") fov *= GYOTO_SECRAD; + else if (unit=="milliarcsec" || unit=="mas") fov *= GYOTO_MASRAD; + else if (unit=="microarcsec" || unit=="µas" || unit=="uas") + fov *= GYOTO_MUASRAD; else { stringstream ss; - ss << "Screen::setFieldOfView(): unknown unit: \"" << unit << "\""; + ss << "Screen::setFieldOfView(): unknown unit: \"" << unit << "\"" + << " (you may have more chance compiling gyoto with --with-udunits)"; throwError(ss.str()); } +# endif setFieldOfView(fov); } void Screen::setFieldOfView(double fov) { fov_ = fov; } +void Screen::setAlpha0(double alpha) { alpha0_ = alpha; } +void Screen::setDelta0(double delta) { delta0_ = delta; } + +void Screen::setAnglekind(int kind) { anglekind_ = kind; } + size_t Screen::getResolution() { return npix_; } void Screen::setResolution(size_t n) { npix_ = n; } +#ifdef HAVE_UDUNITS +void Gyoto::Screen::mapPixUnit() { + Units::Unit radian ("radian"); + double delta = fov_/double(npix_); + ut_unit * pix = ut_scale(delta, radian); + ut_status status = UT_BAD_ARG; + status = ut_map_name_to_unit("pixel", UT_ASCII, pix); + switch (status) { + case UT_SUCCESS: + break; + case UT_EXISTS: + throwError("name \"pixel\" already registered"); + break; + default: + throwError("error initializing \"pixel\" unit"); + } + status = ut_map_symbol_to_unit("pix", UT_ASCII, pix); + switch (status) { + case UT_SUCCESS: + break; + case UT_EXISTS: + throwError("symbol \"pix\" already registered"); + break; + default: + throwError("error initializing \"pixel\" unit"); + } + ut_free(pix); +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "\"pix\" unit mapped\n"; +# endif +} +void Gyoto::Screen::unmapPixUnit() { + ut_system * sys = Units::getSystem(); + if ((ut_unmap_name_to_unit(sys, "pixel", UT_ASCII) != UT_SUCCESS) || + (ut_unmap_symbol_to_unit(sys, "pix", UT_ASCII) != UT_SUCCESS)) + throwError("Error unmapping \"pixel\" unit"); +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "\"pix\" unit unmapped\n"; +# endif +} +#endif + #ifdef GYOTO_USE_XERCES void Screen::fillElement(FactoryMessenger *fmp) { FactoryMessenger* child = NULL; if (gg_) fmp -> setMetric (gg_) ; fmp -> setParameter ("Time", tobs_); fmp -> setParameter ("FieldOfView", fov_); + fmp -> setParameter ("Alpha0", alpha0_); + fmp -> setParameter ("Delta0", delta0_); fmp -> setParameter ("Resolution", npix_); double d = getDistance(); if (gg_() && (gg_->getMass() == 1.)) { @@ -486,15 +810,16 @@ fmp -> setParameter ("PALN", getPALN()); fmp -> setParameter ("Inclination", getInclination()); fmp -> setParameter ("Argument", getArgument()); - if (spectro_ && spectro_ -> getKind() != GYOTO_SPECTRO_KIND_NONE) { + if (spectro_) { child = fmp -> makeChild("Spectrometer"); spectro_ -> fillElement(child) ; delete child; child = NULL; } + fmp -> setParameter ("FreqObs", freq_obs_); + fmp -> setParameter ( anglekind_? "SphericalAngles" : "EquatorialAngles"); } SmartPointer Screen::Subcontractor(FactoryMessenger* fmp) { - string name="", content="", unit="", tunit=""; SmartPointer scr = new Screen(); scr -> setMetric(fmp->getMetric()); @@ -502,12 +827,46 @@ double tobs_tmp, pos[4] ; char * tc; - while (fmp->getNextParameter(&name, &content)) { + // Deal with fov later as we need Inclination + double fov; string fov_unit; int fov_found=0; + double alpha0; int alpha0_found=0; + double delta0; int delta0_found=0; + + int fourvel_found=0, screen1_found=0, + screen2_found=0, screen3_found=0; + + while (fmp->getNextParameter(&name, &content, &unit)) { tc = const_cast(content.c_str()); - unit = fmp -> getAttribute("unit"); +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + GYOTO_DEBUG_EXPR(name); + GYOTO_DEBUG_EXPR(content); + GYOTO_DEBUG_EXPR(unit); + GYOTO_ENDIF_DEBUG +# endif if (name=="Time") {tobs_tmp = atof(tc); tunit=unit; tobs_found=1;} else if (name=="Position") {for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); scr -> setObserverPos (pos); } + else if (name=="FourVelocity") { + fourvel_found=1; + for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); + scr -> setFourVel (pos); + } + else if (name=="ScreenVector1") { + screen1_found=1; + for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); + scr -> setScreen1 (pos); + } + else if (name=="ScreenVector2") { + screen2_found=1; + for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); + scr -> setScreen2 (pos); + } + else if (name=="ScreenVector3") { + screen3_found=1; + for (int i=0;i<4;++i) pos[i] = strtod(tc, &tc); + scr -> setScreen3 (pos); + } else if (name=="Distance") { scr -> setDistance ( atof(tc), unit ); @@ -517,16 +876,43 @@ else if (name=="PALN") scr -> setPALN ( atof(tc), unit ); else if (name=="Inclination") scr -> setInclination ( atof(tc), unit ); else if (name=="Argument") scr -> setArgument ( atof(tc), unit ); - else if (name=="FieldOfView") scr -> setFieldOfView ( atof(tc), unit ); + else if (name=="FieldOfView") { + fov = atof(tc); fov_unit=unit; fov_found=1; + } else if (name=="Resolution") scr -> setResolution ( atoi(tc) ); - else if (name=="Spectrometer") - scr -> setSpectrometer (SpectrometerSubcontractor(fmp->getChild())); + else if (name=="Spectrometer") { + scr -> setSpectrometer ((Spectrometer::getSubcontractor(fmp->getAttribute("kind")))(fmp->getChild())); + } + else if (name=="Alpha0"){ + alpha0 = atof(tc); alpha0_found=1; + } + else if (name=="Delta0"){ + delta0 = atof(tc); delta0_found=1; + } + else if (name=="FreqObs") scr -> setFreqObs(atof(tc), unit); + else if (name=="SphericalAngles") scr -> setAnglekind(1); + else if (name=="EquatorialAngles") scr -> setAnglekind(0); } if (tobs_found) scr -> setTime ( tobs_tmp, tunit ); - if (debug()) - cerr << "DEBUG: Screen::Subcontractor(): dmax_ = " << scr->getDmax() < setFieldOfView ( fov, fov_unit ); + + if (alpha0_found) scr -> setAlpha0(alpha0); + + if (delta0_found) scr -> setDelta0(delta0); + + int sum_found=fourvel_found+screen1_found + +screen2_found+screen3_found; + + if (sum_found>0 && sum_found<4) + throwError("In Screen::subContractor: either all four, or no " + "basis vectors should be given"); + + +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(scr->getDmax()); +# endif return scr; } diff -Nru gyoto-0.0.3/lib/SmartPointer.C gyoto-0.1.0/lib/SmartPointer.C --- gyoto-0.0.3/lib/SmartPointer.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/SmartPointer.C 2013-07-27 09:14:20.000000000 +0000 @@ -23,8 +23,46 @@ #include #include -Gyoto::SmartPointee::SmartPointee() : refCount (0) { } -Gyoto::SmartPointee::SmartPointee(const SmartPointee&) : refCount (0) { } -void Gyoto::SmartPointee::incRefCount () { refCount++; } -int Gyoto::SmartPointee::decRefCount () { return --refCount; } -int Gyoto::SmartPointee::getRefCount() { return refCount; } +Gyoto::SmartPointee::SmartPointee() : + refCount (0) +{ +#ifdef HAVE_PTHREAD + pthread_mutex_init(&mutex_, NULL); +#endif +} +Gyoto::SmartPointee::SmartPointee(const SmartPointee&) : + refCount (0) +{ +#ifdef HAVE_PTHREAD + pthread_mutex_init(&mutex_, NULL); +#endif +} +void Gyoto::SmartPointee::incRefCount () { +#ifdef HAVE_PTHREAD + pthread_mutex_lock(&mutex_); +#endif + refCount++; +#ifdef HAVE_PTHREAD + pthread_mutex_unlock(&mutex_); +#endif +} +int Gyoto::SmartPointee::decRefCount () { +#ifdef HAVE_PTHREAD + pthread_mutex_lock(&mutex_); + int n = --refCount; + pthread_mutex_unlock(&mutex_); + return n; +#else + return --refCount; +#endif +} +int Gyoto::SmartPointee::getRefCount() { +#ifdef HAVE_PTHREAD + pthread_mutex_lock(&mutex_); + int n = refCount; + pthread_mutex_unlock(&mutex_); + return n; +#else + return refCount; +#endif +} diff -Nru gyoto-0.0.3/lib/Spectrometer.C gyoto-0.1.0/lib/Spectrometer.C --- gyoto-0.0.3/lib/Spectrometer.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Spectrometer.C 2013-07-27 09:14:20.000000000 +0000 @@ -18,179 +18,145 @@ */ #include "GyotoSpectrometer.h" +#include "GyotoUniformSpectrometer.h" +#include "GyotoComplexSpectrometer.h" #include "GyotoUtils.h" #include "GyotoFactoryMessenger.h" +#include "GyotoConverters.h" +#include "GyotoMetric.h" #include #include #include #include +#include #include +#include // DBL_MAX using namespace Gyoto; +using namespace Gyoto::Spectrometer; using namespace std; -Spectrometer::Spectrometer() : - kind_(GYOTO_SPECTRO_KIND_NONE), +#if defined GYOTO_USE_XERCES +Register::Entry* Gyoto::Spectrometer::Register_ = NULL; +void Spectrometer::initRegister() { + if (Gyoto::Spectrometer::Register_) delete Gyoto::Spectrometer::Register_; + Gyoto::Spectrometer::Register_ = NULL; + // statically fill the register + Gyoto::Spectrometer::Register("wave", &(Subcontractor)); + Gyoto::Spectrometer::Register("wavelog", &(Subcontractor)); + Gyoto::Spectrometer::Register("freq", &(Subcontractor)); + Gyoto::Spectrometer::Register("freqlog", &(Subcontractor)); + Gyoto::Spectrometer::Register("Complex", &(Subcontractor)); +} + +void Gyoto::Spectrometer::Register(std::string name, Subcontractor_t* scp){ + Register::Entry* ne = + new Register::Entry(name, (SmartPointee::Subcontractor_t*)scp, Gyoto::Spectrometer::Register_); + Gyoto::Spectrometer::Register_ = ne; +} + +Gyoto::Spectrometer::Subcontractor_t* +Spectrometer::getSubcontractor(std::string name, int errmode) { + if (!Gyoto::Spectrometer::Register_) throwError("No Spectrometer kind registered!"); + return (Subcontractor_t*)Gyoto::Spectrometer::Register_ + -> getSubcontractor(name, errmode); +} + +void Spectrometer::Generic::setParameters(Gyoto::FactoryMessenger *fmp) { + string name="", content="", unit=""; + if (fmp) + while (fmp->getNextParameter(&name, &content, &unit)) + setParameter(name, content, unit); +} +#endif + + + +Generic::Generic() : + SmartPointee(), + Teller(), + kind_(NULL), nsamples_(0), + nboundaries_(0), boundaries_(NULL), + chanind_(NULL), midpoints_(NULL), widths_(NULL) -{ - band_[0]=0.; band_[1]=0.; -} -Spectrometer::Spectrometer(size_t nsamples, double band_min, double band_max, - SpectroKind_t kind) : +{} +Generic::Generic(kind_t kind) : + SmartPointee(), + Teller(), kind_(kind), - nsamples_(nsamples), + nsamples_(0), + nboundaries_(0), boundaries_(NULL), + chanind_(NULL), midpoints_(NULL), widths_(NULL) -{ - band_[0]=band_min; band_[1]=band_max; - if (nsamples && kind) reset_(); -} - -Spectrometer::Spectrometer(const Spectrometer& o) : +{} +Generic::Generic(const Generic& o) : SmartPointee(o), + Teller(o), kind_(o.kind_), nsamples_(o.nsamples_), + nboundaries_(o.nboundaries_), boundaries_(NULL), + chanind_(NULL), midpoints_(NULL), widths_(NULL) { - band_[0]=o.band_[0]; band_[1]=o.band_[1]; - reset_(); + if (o.boundaries_) boundaries_=new double[nboundaries_]; + memcpy(boundaries_, o.boundaries_, nboundaries_*sizeof(double)); + if (o.widths_) widths_=new double[nsamples_]; + memcpy(widths_, o.widths_, nsamples_*sizeof(double)); + if (o.midpoints_) midpoints_=new double[nsamples_]; + memcpy(midpoints_, o.midpoints_, nsamples_*sizeof(double)); + if (o.chanind_) chanind_=new size_t[2*nsamples_]; + memcpy(chanind_, o.chanind_, 2*nsamples_*sizeof(size_t)); } - -Spectrometer* Spectrometer::clone() const { return new Spectrometer(*this); } - -Spectrometer::~Spectrometer() { +Generic::~Generic() { if (boundaries_) delete [] boundaries_; - if (midpoints_) delete [] midpoints_; - if (widths_) delete [] widths_; + if (widths_) delete [] widths_; + if (midpoints_) delete [] midpoints_; + if (chanind_) delete [] chanind_; +} + +char const * Generic::getKind() const {return kind_;} +void Generic::setKind(char const * k) {kind_=k; tellListeners();} + +size_t Generic::getNSamples() const { return nsamples_; } +size_t Generic::getNBoundaries() const { return nboundaries_; } + +double const * Generic::getMidpoints() const { return midpoints_; } +void Generic::getMidpoints( double data[], std::string unit) { + for (size_t i=0; i setSelfAttribute( "kind", getKindStr() ); - fmp -> setSelfAttribute( "nsamples", nsamples_ ); - ostringstream ss; - ss << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << band_[0] << " " - << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << band_[1]; - fmp -> setFullContent(ss.str()); -} - -SmartPointer -Gyoto::SpectrometerSubcontractor(FactoryMessenger* fmp) { - - string skind = fmp -> getSelfAttribute( "kind" ); - size_t nsamples = atol( fmp -> getSelfAttribute( "nsamples" ) . c_str () ); - string content = fmp -> getFullContent(); - char * tc = const_cast(content.c_str()); - double band[2]; - band[0]=strtod(tc, &tc); - band[1]=strtod(tc, &tc); - - Spectrometer* spr =new Spectrometer(); - spr -> setBand(band); - spr -> setNSamples(nsamples); - spr -> setKind(skind); - - return spr; - +void Generic::fillElement(FactoryMessenger *fmp) const { + fmp -> setSelfAttribute( "kind", getKind() ); } - - #endif diff -Nru gyoto-0.0.3/lib/Spectrum.C gyoto-0.1.0/lib/Spectrum.C --- gyoto-0.0.3/lib/Spectrum.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Spectrum.C 2013-07-27 09:14:20.000000000 +0000 @@ -37,6 +37,7 @@ return const_cast(this); // avoid warning, we won't get to that point } +Spectrum::Generic::~Generic() { GYOTO_DEBUG << endl; } const string Spectrum::Generic::getKind() const { return kind_; } double Spectrum::Generic::integrate(double nu1, double nu2) { @@ -124,7 +125,14 @@ void Spectrum::Generic::fillElement(FactoryMessenger *fmp ) const { fmp->setSelfAttribute("kind", kind_); } -void Spectrum::Generic::setParameter(std::string, std::string) {} +void Spectrum::Generic::setParameter(std::string, std::string, std::string) {} + +void Spectrum::Generic::setParameters(FactoryMessenger *fmp) { + string name="", content="", unit=""; + if (fmp) + while (fmp->getNextParameter(&name, &content, &unit)) + setParameter(name, content, unit); +} Register::Entry* Gyoto::Spectrum::Register_ = NULL; @@ -138,10 +146,11 @@ Gyoto::Spectrum::Register_ = ne; } -Spectrum::Subcontractor_t* Spectrum::getSubcontractor(std::string name) { +Spectrum::Subcontractor_t* +Spectrum::getSubcontractor(std::string name, int errmode) { if (!Gyoto::Spectrum::Register_) throwError("No Spectrum kind registered!"); return (Spectrum::Subcontractor_t*)Gyoto::Spectrum::Register_ - -> getSubcontractor(name); + -> getSubcontractor(name, errmode); } void Gyoto::Spectrum::initRegister() { diff -Nru gyoto-0.0.3/lib/StandardAstrobj.C gyoto-0.1.0/lib/StandardAstrobj.C --- gyoto-0.0.3/lib/StandardAstrobj.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/StandardAstrobj.C 2013-07-27 09:14:20.000000000 +0000 @@ -43,37 +43,48 @@ Generic(kind), critical_value_(DBL_MIN), safety_value_(DBL_MAX) { - if (debug()) cerr << "Standard Astrobj Construction" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } Standard::Standard() : Generic(), critical_value_(DBL_MIN), safety_value_(DBL_MAX) { - if (debug()) cerr << "Standard Astrobj Construction" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } Standard::Standard(double radmax) : Generic(radmax), critical_value_(DBL_MIN), safety_value_(DBL_MAX) { - if (debug()) cerr << "Astrobj Construction" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } Standard::Standard(const Standard& orig) : Generic(orig), Functor::Double_constDoubleArray(orig), critical_value_(orig.critical_value_), safety_value_(orig.safety_value_) { - if (debug()) cerr << "DEBUG: Astrobj::Standard (Copy)" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } Standard::~Standard() { - if (debug()) cerr << "DEBUG: Astrobj::Standard::~Standard()" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } int Standard::Impact(Photon* ph, size_t index, Properties *data){ - if (debug()) - cerr << "DEBUG: Standard::Impact called for " << getKind() << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(getKind()); +# endif double p1[8], p2[8]; ph->getCoord(index, p1); ph->getCoord(index+1, p2); @@ -81,8 +92,8 @@ if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ //Allows theta and phi to be in the correct range - checkPhiTheta(p1); - checkPhiTheta(p2); + ph->checkPhiTheta(p1); + ph->checkPhiTheta(p2); } double t1 = p1[0], t2=p2[0]; @@ -151,14 +162,15 @@ double Standard::giveDelta(double *) {return 0.05;} -int Standard::setParameter(string name, string content) { +int Standard::setParameter(string name, string content, string unit) { if (name == "SafetyValue") safety_value_ = atof(content.c_str()); - else return Generic::setParameter(name, content); + else return Generic::setParameter(name, content, unit); return 0; } #ifdef GYOTO_USE_XERCES void Standard::fillElement(FactoryMessenger* fmp) const { fmp -> setParameter("SafetyValue", safety_value_); + Generic::fillElement(fmp); } #endif diff -Nru gyoto-0.0.3/lib/Star.C gyoto-0.1.0/lib/Star.C --- gyoto-0.0.3/lib/Star.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Star.C 2013-07-27 09:14:20.000000000 +0000 @@ -38,8 +38,7 @@ Star::Star() : UniformSphere("Star"), - Worldline(), - wait_pos_(0), init_vel_(NULL) + Worldline() { if (debug()) cerr << "DEBUG: in Star::Star()" << endl; @@ -49,8 +48,7 @@ double pos[4], double v[3]) : UniformSphere("Star"), - Worldline(), - wait_pos_(0), init_vel_(NULL) + Worldline() { if (debug()) { cerr << "DEBUG: Star Construction " << endl @@ -68,14 +66,9 @@ } Star::Star(const Star& orig) : - UniformSphere(orig), Worldline(orig), - wait_pos_(orig.wait_pos_), init_vel_(NULL) + UniformSphere(orig), Worldline(orig) { - if (debug()) cerr << "Star copy" << endl; - if (orig.init_vel_) { - init_vel_ = new double [3]; - memcpy(init_vel_, orig.init_vel_, 3*sizeof(double)); - } + GYOTO_DEBUG << endl; gg_ = metric_; // we have two distinct clones of the metric, not good... } @@ -83,7 +76,6 @@ Star::~Star() { if (debug()) cerr << "DEBUG: Star::~Star()\n"; - if (init_vel_) delete[] init_vel_; } string Star::className() const { return string("Star"); } @@ -95,15 +87,6 @@ Worldline::setMetric(gg); } -void Star::setInitCoord(double pos[4], double v[3], int dir) { - if (!metric_) throwError("Please set metric before calling Star::setInitCoord(double pos[4], double vel[3])"); - double tdot0=metric_->SysPrimeToTdot(pos, v); - if (debug()) cerr << "DEBUG: Star::setInitCoord(): TDOT0=" << tdot0 << endl; - double coord[8]={pos[0], pos[1], pos[2], pos[3], - tdot0, v[0]*tdot0, v[1]*tdot0, v[2]*tdot0}; - setInitCoord(coord, dir); -} - void Star::setInitialCondition(double coord[8]) { if (!metric_) throwError("Please set metric before calling Star::setInitialCondition(double*)"); Worldline::setInitialCondition(metric_, coord, 1); @@ -141,62 +124,27 @@ rmax_=DBL_MAX; } -void Star::setPosition(double pos[4]) { - double vel[] = {0., 0., 0.}; - setInitCoord(pos, vel); -} - -void Star::setVelocity(double vel[3]) { - double coord[8]; - getInitialCoord(coord); - setInitCoord(coord, vel); -} - -int Star::setParameter(std::string name, std::string content) { - double coord[8]; - char* tc = const_cast(content.c_str()); - if (name=="InitialCoordinate") { - for (int i=0;i<8;++i) coord[i] = strtod(tc, &tc); - setInitCoord(coord); - } else if (name=="Position") { - for (int i=0;i<4;++i) coord[i] = strtod(tc, &tc); - if (init_vel_) { - setInitCoord(coord, init_vel_); - delete[] init_vel_; init_vel_=NULL; - } else setPosition(coord); - wait_pos_ = 0; - } else if (name=="Velocity") { - for (int i=0;i<3;++i) coord[i] = strtod(tc, &tc); - if (wait_pos_) { - if (init_vel_) delete [] init_vel_; - init_vel_ = new double[3]; - memcpy(init_vel_, coord, 3*sizeof(double)); - } else setVelocity(coord); - } else return UniformSphere::setParameter(name, content); +int Star::setParameter(string name, string content, string unit) { + if (!UniformSphere::setParameter(name, content, unit)) ; // if found + else if (!Worldline ::setParameter(name, content, unit)) ; // do nothing + else return 1; return 0; } #ifdef GYOTO_USE_XERCES void Star::fillElement(FactoryMessenger *fmp) const { - - if (imin_ <= imax_) { - double coord[8]; - getInitialCoord(coord); - fmp -> setParameter ("Position", coord, 4); - double vel[3] = {coord[5]/coord[4], coord[6]/coord[4], coord[7]/coord[4]}; - fmp -> setParameter ("Velocity", vel, 3); - } - + Worldline::fillElement(fmp); Astrobj::UniformSphere::fillElement(fmp); } void Star::setParameters(FactoryMessenger* fmp) { wait_pos_ = 1; UniformSphere::setParameters(fmp); + wait_pos_ = 0; if (init_vel_) { delete[] init_vel_; init_vel_=NULL; - throwError("Star::setParameters(): Velocity was found but not Position"); + throwError("Worldline::setParameters(): " + "Velocity was found but not Position"); } - wait_pos_ = 0; } #endif diff -Nru gyoto-0.0.3/lib/StdPlug.C gyoto-0.1.0/lib/StdPlug.C --- gyoto-0.0.3/lib/StdPlug.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/StdPlug.C 2013-07-27 09:14:20.000000000 +0000 @@ -28,6 +28,7 @@ #include "GyotoThinDisk.h" #include "GyotoPageThorneDisk.h" #include "GyotoThinDiskPL.h" +#include "GyotoPolishDoughnut.h" #ifdef GYOTO_USE_CFITSIO #include "GyotoPatternDisk.h" #include "GyotoPatternDiskBB.h" @@ -42,9 +43,10 @@ using namespace Gyoto; extern "C" void __GyotostdplugInit() { +#if defined GYOTO_USE_XERCES // Register Metrics - Gyoto::Metric::KerrBL::Init(); - Gyoto::Metric::KerrKS::Init(); + Metric::Register("KerrBL", &(Metric::Subcontractor)); + Metric::Register("KerrKS", &(Metric::Subcontractor)); // Register Astrobjs Astrobj::Register("Complex", &(Astrobj::Subcontractor)); Astrobj::Register("Star", &(Astrobj::Subcontractor)); @@ -55,6 +57,8 @@ &(Astrobj::Subcontractor)); Astrobj::Register("ThinDiskPL", &(Astrobj::Subcontractor)); + Astrobj::Register("PolishDoughnut", + &(Astrobj::Subcontractor)); #ifdef GYOTO_USE_CFITSIO Astrobj::Register("PatternDisk", &(Astrobj::Subcontractor)); @@ -68,6 +72,9 @@ &(Astrobj::Subcontractor)); #endif // Register Spectra - Gyoto::Spectrum::PowerLawInit(); - Gyoto::Spectrum::BlackBodyInit(); + Spectrum::Register("PowerLaw", + &(Spectrum::Subcontractor)); + Spectrum::Register("BlackBody", + &(Spectrum::Subcontractor)); +#endif } diff -Nru gyoto-0.0.3/lib/ThinDisk.C gyoto-0.1.0/lib/ThinDisk.C --- gyoto-0.0.3/lib/ThinDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/ThinDisk.C 2013-07-27 09:14:20.000000000 +0000 @@ -56,11 +56,33 @@ } double ThinDisk::getInnerRadius() const { return rin_; } +double ThinDisk::getInnerRadius(string unit) const { + return Units::FromGeometrical(getInnerRadius(), unit, gg_); +} void ThinDisk::setInnerRadius(double r) { rin_ = r; } +void ThinDisk::setInnerRadius(double r, string unit) { + setInnerRadius(Units::ToGeometrical(r, unit, gg_)); +} + + double ThinDisk::getOuterRadius() const { return rout_;} +double ThinDisk::getOuterRadius(string unit) const { + return Units::FromGeometrical(getOuterRadius(), unit, gg_); +} void ThinDisk::setOuterRadius(double r) { rout_ = r; } +void ThinDisk::setOuterRadius(double r, string unit) { + setOuterRadius(Units::ToGeometrical(r, unit, gg_)); +} + double ThinDisk::getThickness() const { return thickness_;} +double ThinDisk::getThickness(string unit) const { + return Units::FromGeometrical(getThickness(), unit, gg_); +} void ThinDisk::setThickness(double h) { thickness_ = h; } +void ThinDisk::setThickness(double h, string unit) { + setThickness(Units::ToGeometrical(h, unit, gg_)); +} + int ThinDisk::getDir() const { return dir_; } void ThinDisk::setDir(int dir) { dir_ = dir; } @@ -120,8 +142,8 @@ if (gg_ -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ //Allows theta and phi to be in the correct range - checkPhiTheta(coord1); - checkPhiTheta(coord2); + ph->checkPhiTheta(coord1); + ph->checkPhiTheta(coord2); } @@ -175,13 +197,15 @@ return 1; } -int ThinDisk::setParameter(std::string name, std::string content) { +int ThinDisk::setParameter(std::string name, + std::string content, + std::string unit) { char* tc = const_cast(content.c_str()); - if (name=="InnerRadius") setInnerRadius (atof(tc)); - else if (name=="OuterRadius") setOuterRadius (atof(tc)); - else if (name=="Thickness") setThickness (atof(tc)); + if (name=="InnerRadius") setInnerRadius (atof(tc), unit); + else if (name=="OuterRadius") setOuterRadius (atof(tc), unit); + else if (name=="Thickness") setThickness (atof(tc), unit); else if (name=="CounterRotating") setDir (-1); - else return Generic::setParameter(name, content); + else return Generic::setParameter(name, content, unit); return 0; } diff -Nru gyoto-0.0.3/lib/ThinDiskPL.C gyoto-0.1.0/lib/ThinDiskPL.C --- gyoto-0.0.3/lib/ThinDiskPL.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/ThinDiskPL.C 2013-07-27 09:14:20.000000000 +0000 @@ -41,8 +41,8 @@ ThinDiskPL::ThinDiskPL() : ThinDisk("ThinDiskPL"), - spectrumBB_(NULL), - PLSlope_(0.), PLRho_(1.), PLRadRef_(1.) + PLSlope_(0.), PLRho_(1.), PLRadRef_(1.), + spectrumBB_(NULL) { if (debug()) cerr << "DEBUG: ThinDiskPL Construction" << endl; spectrumBB_ = new Spectrum::BlackBody(); @@ -50,8 +50,8 @@ ThinDiskPL::ThinDiskPL(const ThinDiskPL& o) : ThinDisk(o), - spectrumBB_(NULL), - PLSlope_(o.PLSlope_), PLRho_(o.PLRho_), PLRadRef_(o.PLRadRef_) + PLSlope_(o.PLSlope_), PLRho_(o.PLRho_), PLRadRef_(o.PLRadRef_), + spectrumBB_(NULL) { if (o.gg_()) gg_=o.gg_->clone(); if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone(); @@ -103,13 +103,15 @@ return (*spectrumBB_)(nu); } -int ThinDiskPL::setParameter(std::string name, std::string content) { +int ThinDiskPL::setParameter(std::string name, + std::string content, + std::string unit) { if (name=="PLSlope") PLSlope_=atof(content.c_str()); else if (name=="PLRho") PLRho_=atof(content.c_str()); else if (name=="PLRadRef") PLRadRef_=atof(content.c_str()); else if (name=="Rmin") setInnerRadius(atof(content.c_str())); else if (name=="Rmax") setOuterRadius(atof(content.c_str())); - else return ThinDisk::setParameter(name, content); + else return ThinDisk::setParameter(name, content, unit); return 0; } diff -Nru gyoto-0.0.3/lib/Torus.C gyoto-0.1.0/lib/Torus.C --- gyoto-0.0.3/lib/Torus.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/Torus.C 2013-07-27 09:14:20.000000000 +0000 @@ -56,12 +56,26 @@ Torus* Torus::clone() const { return new Torus(*this); } double Torus::getLargeRadius() const { return c_; } +double Torus::getLargeRadius(string unit) const { + return Units::FromGeometrical(getLargeRadius(), unit, gg_); +} double Torus::getSmallRadius() const { return sqrt(critical_value_); } +double Torus::getSmallRadius(string unit) const { + return Units::FromGeometrical(getSmallRadius(), unit, gg_); +} + void Torus::setLargeRadius(double c) { c_ = c; } +void Torus::setLargeRadius(double c, string unit) { + setLargeRadius(Units::ToGeometrical(c, unit, gg_)); +} + void Torus::setSmallRadius(double a) { critical_value_ = a*a; safety_value_ = critical_value_ * 1.1; } +void Torus::setSmallRadius(double c, string unit) { + setSmallRadius(Units::ToGeometrical(c, unit, gg_)); +} SmartPointer Torus::getSpectrum() const { return spectrum_; } void Torus::setSpectrum(SmartPointer sp) {spectrum_=sp;} @@ -109,6 +123,7 @@ break; default: throwError("Torus::distance(): unknown coordinate system kind"); + h=0.,drproj=0.; } return drproj*drproj + h*h; } @@ -132,10 +147,12 @@ gg_ -> circularVelocity(pos2, vel); } -int Torus::setParameter(std::string name, std::string content) { - if (name=="LargeRadius") setLargeRadius(atof(content.c_str())); - else if (name=="SmallRadius") setSmallRadius(atof(content.c_str())); - else return Standard::setParameter(name, content); +int Torus::setParameter(std::string name, + std::string content, + std::string unit) { + if (name=="LargeRadius") setLargeRadius(atof(content.c_str()), unit); + else if (name=="SmallRadius") setSmallRadius(atof(content.c_str()), unit); + else return Standard::setParameter(name, content, unit); return 0; } @@ -161,14 +178,14 @@ void Torus::setParameters(FactoryMessenger* fmp) { - string name="", content=""; + string name="", content="", unit=""; SmartPointer gg = NULL; SmartPointer sp = NULL; FactoryMessenger * child = NULL; setMetric(fmp->getMetric()); - while (fmp->getNextParameter(&name, &content)) { + while (fmp->getNextParameter(&name, &content, &unit)) { if (name=="Spectrum") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); @@ -181,7 +198,7 @@ setOpacity( (*Spectrum::getSubcontractor(content))(child) ); delete child; } - else setParameter(name, content); + else setParameter(name, content, unit); } } #endif diff -Nru gyoto-0.0.3/lib/UniformSpectrometer.C gyoto-0.1.0/lib/UniformSpectrometer.C --- gyoto-0.0.3/lib/UniformSpectrometer.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/lib/UniformSpectrometer.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,242 @@ +/* + Copyright 2013 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include "GyotoUniformSpectrometer.h" +#include "GyotoUtils.h" +#include "GyotoFactoryMessenger.h" +#include "GyotoConverters.h" +#include "GyotoMetric.h" + +#include +#include +#include +#include +#include +#include +#include // DBL_MAX +using namespace Gyoto; +using namespace Gyoto::Spectrometer; +using namespace std; + +Uniform::Uniform() : + Generic(WaveKind) +{ + band_[0]=0.; band_[1]=0.; +} +Uniform::Uniform(size_t nsamples, double band_min, double band_max, kind_t kind) +: Generic(kind) +{ + nsamples_=nsamples; + band_[0]=band_min; band_[1]=band_max; + if (nsamples && kind) reset_(); +} + +Uniform::Uniform(const Uniform& o) : + Generic(o) +{ + band_[0]=o.band_[0]; band_[1]=o.band_[1]; + reset_(); +} + +Generic* Uniform::clone() const { return new Uniform(*this); } + +Uniform::~Uniform() { +} + +void Uniform::reset_() { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif + if (boundaries_) delete [] boundaries_; + if (chanind_) delete [] chanind_; + if (midpoints_) delete [] midpoints_; + if (widths_) delete [] widths_; + boundaries_ = NULL; + chanind_ = NULL; + midpoints_ = NULL; + widths_ = NULL; + GYOTO_DEBUG << endl; + if (!nsamples_ || !kind_) return; + + boundaries_ = new double[nsamples_+1]; + chanind_ = new size_t[nsamples_*2]; + midpoints_ = new double[nsamples_]; + widths_ = new double[nsamples_]; + + size_t i=0 ; +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG; + GYOTO_DEBUG_EXPR(band_); + if (band_) GYOTO_DEBUG_ARRAY(band_, 2); + GYOTO_DEBUG_EXPR(kind_); + GYOTO_ENDIF_DEBUG +# endif + for (i=0; i<=nsamples_; ++i){ +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "boundaries_[" < setSelfAttribute( "nsamples", nsamples_ ); + ostringstream ss; + ss << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << band_[0] << " " + << setprecision(GYOTO_PREC) << setw(GYOTO_WIDTH) << band_[1]; + fmp -> setFullContent(ss.str()); + Generic::fillElement(fmp); +} + +void Gyoto::Spectrometer::Uniform::setParameters(FactoryMessenger* fmp) { + string skind = fmp -> getSelfAttribute( "kind" ); + size_t nsamples = atol( fmp -> getSelfAttribute( "nsamples" ) . c_str () ); + string unit = fmp -> getSelfAttribute( "unit" ); + + string content = fmp -> getFullContent(); + char * tc = const_cast(content.c_str()); + double band[2]; + band[0]=strtod(tc, &tc); + band[1]=strtod(tc, &tc); + + setBand(band, unit, skind); + setNSamples(nsamples); +} +#endif + +int Spectrometer::Uniform::setParameter(string name, + string content, + string unit) +{ + double band[2]; + char* tc = const_cast(content.c_str()); + if (name=="Band") { + for (int i=0;i<2;++i) band[i] = strtod(tc, &tc); + setBand(band, unit); + } else if (name=="Kind") { + setKind(content); + } else if (name=="NSamples") { + setNSamples(atof(tc)); + } else return Generic::setParameter(name, content, unit); + return 0; +} + +char const * const Uniform::WaveKind = "wave"; +char const * const Uniform::WaveLogKind = "wavelog"; +char const * const Uniform::FreqKind = "freq"; +char const * const Uniform::FreqLogKind = "freqlog"; diff -Nru gyoto-0.0.3/lib/UniformSphere.C gyoto-0.1.0/lib/UniformSphere.C --- gyoto-0.0.3/lib/UniformSphere.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/UniformSphere.C 2013-07-27 09:14:20.000000000 +0000 @@ -23,6 +23,7 @@ #include "GyotoPowerLawSpectrum.h" #include "GyotoBlackBodySpectrum.h" #include "GyotoFactoryMessenger.h" +#include "GyotoConverters.h" #include #include @@ -41,8 +42,10 @@ spectrum_(NULL), opacity_(NULL) { - if (debug()) - cerr << "DEBUG: in UniformSphere::UniformSphere()" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif + setRadius(0.); spectrum_ = new Spectrum::BlackBody(); @@ -69,13 +72,17 @@ radius_(orig.radius_), spectrum_(NULL), opacity_(NULL) { - if (debug()) cerr << "UniformSphere copy" << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif if (orig.spectrum_()) spectrum_=orig.spectrum_->clone(); if (orig.opacity_()) opacity_=orig.opacity_->clone(); } UniformSphere::~UniformSphere() { - if (debug()) cerr << "DEBUG: UniformSphere::~UniformSphere()\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << endl; +# endif } string UniformSphere::className() const { return string("UniformSphere"); } @@ -121,9 +128,13 @@ double UniformSphere::transmission(double nuem, double dsem, double*) const { if (!flag_radtransf_) return 0.; double opacity = (*opacity_)(nuem); - if (debug()) - cerr << "DEBUG: UniformSphere::transmission(nuem="<getMetric()); - setFlag_radtransf(0); - while (fmp->getNextParameter(&name, &content)) { + while (fmp->getNextParameter(&name, &content, &unit)) { if (name=="Spectrum") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); - if (debug()) - cerr << "DEBUG: UniformSphere::setParameters(): setSpectrum()\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "setSpectrum()" << endl; +# endif setSpectrum((*Spectrum::getSubcontractor(content))(child)); delete child; } else if (name=="Opacity") { content = fmp -> getAttribute("kind"); child = fmp -> getChild(); - if (debug()) - cerr << "DEBUG: UniformSphere::setParameters(): setOpacity()\n"; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "setOpacity()" << endl; +# endif setOpacity((*Spectrum::getSubcontractor(content))(child)); setFlag_radtransf(1); delete child; } else { - if (debug()) - cerr << "DEBUG: UniformSphere::setParameters(): setParameter(" - < #include //#include +#include #include #include #include +#include #include #include #include @@ -30,28 +32,44 @@ using namespace Gyoto; -Worldline::Worldline() : imin_(1), i0_(0), imax_(0), - delta_(0.01), tlim_(0.), cst_(NULL), cst_n_(0) +Worldline::Worldline() : imin_(1), i0_(0), imax_(0), adaptive_(1), + delta_(GYOTO_DEFAULT_DELTA), + tmin_(-DBL_MAX), cst_(NULL), cst_n_(0), + wait_pos_(0), init_vel_(NULL), + maxiter_(GYOTO_DEFAULT_MAXITER) { xAllocate(); } -Worldline::Worldline(const size_t sz) : imin_(1), i0_(0), imax_(0), - delta_(0.01), tlim_(0.), - cst_(NULL), cst_n_(0) +Worldline::Worldline(const size_t sz) : imin_(1), i0_(0), imax_(0), + adaptive_(1), + delta_(GYOTO_DEFAULT_DELTA), + tmin_(-DBL_MAX), + cst_(NULL), cst_n_(0), + wait_pos_(0), init_vel_(NULL), + maxiter_(GYOTO_DEFAULT_MAXITER) { xAllocate(sz); } Worldline::Worldline(const Worldline& orig) : metric_(NULL), x_size_(orig.x_size_), imin_(orig.imin_), i0_(orig.i0_), imax_(orig.imax_), - delta_(orig.delta_), tlim_(orig.tlim_), cst_n_(orig.cst_n_) + adaptive_(orig.adaptive_), + delta_(orig.delta_), tmin_(orig.tmin_), cst_(NULL), cst_n_(orig.cst_n_), + wait_pos_(orig.wait_pos_), init_vel_(NULL), + maxiter_(orig.maxiter_) { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; +# endif if (orig.metric_()) { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "cloning metric\n"; +# endif metric_=orig.metric_->clone(); } xAllocate(x_size_); size_t sz = get_nelements()*sizeof(double); +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "sz="<metric_), // x_size_(orig.x_size_), imin_(orig.imin_), i0_(orig.i0_), imax_(orig.imax_), - delta_(orig->delta_), tlim_(orig->tlim_), cst_n_(orig->cst_n_) + adaptive_(orig->adaptive_), + delta_(orig->delta_), tmin_(orig->tmin_), cst_n_(orig->cst_n_), + wait_pos_(orig->wait_pos_), init_vel_(NULL), + maxiter_(orig->maxiter_) { +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; +# endif double d1 = orig->x0_[i0], d2 = orig->x0_[i0+dir]; x_size_= size_t(fabs(d1-d2)/step_max)+2; - double step = (d2-d1)/(x_size_-1); + double step = (d2-d1)/double(x_size_-1); xAllocate(x_size_); imin_=0; imax_=x_size_-1; i0_=(dir==1?imin_:imax_); x0_[i0_]=d1; @@ -87,27 +118,46 @@ orig->getCoord(x0_, x_size_, x1_, x2_, x3_, x0dot_, x1dot_, x2dot_, x3dot_); - if (debug()) +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG { - cerr << "DEBUG: Worldline::Worldline(Worldline*, " - <cst_, cst_n_*sizeof(double)); } - GYOTO_DEBUG << "out\n"; + /* + if (orig->init_vel_) { + init_vel_ = new double [3]; + memcpy(init_vel_, orig->init_vel_, 3*sizeof(double)); + } + */ +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "done\n"; +# endif } Worldline::~Worldline(){ +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << endl; +# endif + if (metric_) metric_ -> unhook(this); delete[] x0_; delete[] x1_; delete[] x2_; @@ -117,12 +167,15 @@ delete[] x2dot_; delete[] x3dot_; if (cst_) delete [] cst_; + if (init_vel_) delete[] init_vel_; } void Worldline::xAllocate() {xAllocate(GYOTO_DEFAULT_X_SIZE);} void Worldline::xAllocate(size_t sz) { - GYOTO_DEBUG << "sz=" << sz << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(sz); +# endif x_size_ = sz ; x0_ = new double[x_size_]; x1_ = new double[x_size_]; @@ -135,7 +188,9 @@ } size_t Worldline::xExpand(int dir) { - GYOTO_DEBUG<< "Wl: Expand in dir " << dir ; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(dir); +# endif double * old; size_t offset=(dir==1)?0:x_size_; size_t retval=(dir==1)?(x_size_-1):x_size_; @@ -190,35 +245,112 @@ i0_+=offset; imax_+=offset; +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG<< ", xsize_=" << x_size_ << ", imin_=" << imin_ << ", i0_=" << i0_ << ", imax_=" << imax_; +# endif return retval; } void Worldline::setMetric(SmartPointer gg) { + // Unhook from previous metric + if (metric_) metric_ -> unhook(this); + // Set the Metric metric_=gg; - GYOTO_DEBUG << "imin_=" << imin_ << ", i0_=" << i0_ - << ", imax_=" << imax_ << endl; - if (imin_ <= imax_) { - // Initial condition has been set previously - // Forget integration - imin_=imax_=i0_; + // Hook to new metric + if (metric_) metric_ -> hook(this); + + // Reset integration + reInit(); +} + +void Worldline::tell(Gyoto::Hook::Teller* msg) { + if (msg != metric_) { + throwError("Worldline::tell(): wrong Teller"); + } + reInit(); +} + +#ifdef GYOTO_USE_XERCES +void Worldline::fillElement(FactoryMessenger *fmp) const { + if (metric_) fmp -> setMetric (metric_) ; + + if (imin_ <= imax_) { double coord[8]; getInitialCoord(coord); - if ( metric_() -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL - && x2_[i0_]==0. ) { - if (verbose() >= GYOTO_SEVERE_VERBOSITY) - cerr << "SEVERE: Worldline::setMetric(): Kicking particle off z axis\n"; - x2_[i0_]=coord[2]=1e-10; + if (getMass()) { + // For massive particule, express initial condition with 3-velocity + double vel[3] = {coord[5]/coord[4], coord[6]/coord[4], coord[7]/coord[4]}; + fmp -> setParameter ("Position", coord, 4); + fmp -> setParameter ("Velocity", vel, 3); + } else { + // For massless particle, only 4-velocity is meaningfull + fmp -> setParameter("InitCoord", coord, 8); } - metric_ -> setParticleProperties(this,coord); } + if (delta_ != GYOTO_DEFAULT_DELTA) { +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG <<"fmp -> setParameter (\"Delta\", "< setParameter ("Delta", delta_); + } + + if (!adaptive_) fmp->setParameter("NonAdaptive"); + + if (maxiter_ != GYOTO_DEFAULT_MAXITER) + fmp -> setParameter("MaxIter", maxiter_); +} + +void Worldline::setParameters(FactoryMessenger* fmp) { + if (!fmp) return; + string name="", content="", unit=""; + wait_pos_ = 1; + setMetric(fmp->getMetric()); + while (fmp->getNextParameter(&name, &content, &unit)) + setParameter(name, content, unit); + wait_pos_ = 0; + if (init_vel_) { + delete[] init_vel_; init_vel_=NULL; + throwError("Worldline::setParameters(): " + "Velocity was found but not Position"); + } +} +#endif + +int Worldline::setParameter(std::string name, + std::string content, + std::string unit) { + double coord[8]; + char* tc = const_cast(content.c_str()); + if (name=="InitialCoordinate" || name=="InitCoord") { + for (int i=0;i<8;++i) coord[i] = strtod(tc, &tc); + setInitCoord(coord); + } else if (name=="Position") { + for (int i=0;i<4;++i) coord[i] = strtod(tc, &tc); + if (init_vel_) { + setInitCoord(coord, init_vel_); + delete[] init_vel_; init_vel_=NULL; + } else setPosition(coord); + wait_pos_ = 0; + } else if (name=="Velocity") { + for (int i=0;i<3;++i) coord[i] = strtod(tc, &tc); + if (wait_pos_) { + if (init_vel_) delete [] init_vel_; + init_vel_ = new double[3]; + memcpy(init_vel_, coord, 3*sizeof(double)); + } else setVelocity(coord); + } else if (name=="Delta") setDelta(atof(content.c_str()), unit); + else if (name=="MaxIter") maxiter_ = atoi(content.c_str()); + else if (name=="NonAdaptive") adaptive_ = false; + else if (name=="Adaptive") adaptive_ = true; + else return 1; + return 0; } SmartPointer Worldline::getMetric() const { return metric_; } @@ -237,32 +369,62 @@ x1dot_[i0_]=coord[5]; x2dot_[i0_]=coord[6]; x3dot_[i0_]=coord[7]; - if (metric_()) { - double coo[8]; - memcpy(coo, coord, 8*sizeof(double)); - if ( metric_() -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL - && x2_[i0_]==0. ) { - if (verbose() >= GYOTO_SEVERE_VERBOSITY) { - cerr << "SEVERE: Worldline::setInitialCondition("<getKind() - <<", ["< setParticleProperties(this,coord); - } + reInit(); +} + +void Worldline::setInitCoord(double pos[4], double v[3], int dir) { + if (!getMass()) + throwError("Worldline::setInitCoord(pos, vel) " + "only makes sense for massive particles"); + if (!metric_) + throwError("Please set metric before calling " + "Worldline::setInitCoord(double pos[4], double vel[3])"); + double tdot0=metric_->SysPrimeToTdot(pos, v); + GYOTO_DEBUG_EXPR(tdot0); + double coord[8]={pos[0], pos[1], pos[2], pos[3], + tdot0, v[0]*tdot0, v[1]*tdot0, v[2]*tdot0}; + GYOTO_DEBUG_ARRAY(coord, 8); + setInitCoord(coord, dir); } void Worldline::setInitialCondition(SmartPointer met, const double coord[8], const int dir) { - metric_=met; + if (met) metric_=met; setInitCoord(coord, dir); } +void Worldline::setPosition(double pos[4]) { + double vel[] = {0., 0., 0.}; + setInitCoord(pos, vel); +} + +void Worldline::setVelocity(double vel[3]) { + double coord[8]; + getInitialCoord(coord); + setInitCoord(coord, vel); +} + + + void Worldline::reset() { imin_=imax_=i0_; } +void Worldline::reInit() { + if (imin_ <= imax_) { + reset(); + double coord[8]; + getInitialCoord(coord); + if (metric_) { + if ( metric_() -> getCoordKind() == GYOTO_COORDKIND_SPHERICAL + && x2_[i0_]==0. ) { + if (verbose() >= GYOTO_SEVERE_VERBOSITY) + cerr << "SEVERE: Worldline::setMetric(): Kicking particle off z axis\n"; + x2_[i0_]=coord[2]=1e-10; + } + metric_ -> setParticleProperties(this,coord); + } + } +} void Worldline::xFill(double tlim) { @@ -283,14 +445,24 @@ ind = (imin_==0)?xExpand(-1):imin_; } else return ; // nothing to do - GYOTO_DEBUG<< "Worldline.C: Integrating worldline " ; +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG<< "Integrating worldline " ; +# endif // Set up integration double MassPart=getMass(); if (MassPart==1.) { - GYOTO_DEBUG<< "of massive particule ....." << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + cerr << "of massive particule ....." << endl; + GYOTO_ENDIF_DEBUG +# endif }else if(MassPart==0.){ - GYOTO_DEBUG<< "of 0-mass particule ....." << endl; +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + cerr << "of 0-mass particule ....." << endl; + GYOTO_ENDIF_DEBUG +# endif }else{ throwError("In Worldline.C Unrecognized mass."); //GYOTO_DEBUG<< "of unrecognized mass (!!) particule ....." << endl; @@ -300,20 +472,20 @@ double coord[8]={x0_[ind], x1_[ind], x2_[ind], x3_[ind], x0dot_[ind], x1dot_[ind], x2dot_[ind], x3dot_[ind]}; - SmartPointer state - = new WorldlineIntegState(metric_, coord, dir*delta_); + SmartPointer state + = new IntegState(this, coord, dir*delta_); //delta_ = initial integration step (defaults to 0.01) - int mycount=0, mycountmax=100000;// to prevent infinite integration + int mycount=0;// to prevent infinite integration while (!stopcond) { mycount++; ind+=dir; - stopcond= state -> nextStep(this,coord); + stopcond= state -> nextStep(coord); //if (stopcond && debug()) cout << "stopcond from integrator" << endl; - if (mycount==mycountmax) { + if (mycount==maxiter_) { stopcond=1; Error ( "***WARNING STOP: in Worldline.C unexplained stop !!!" ); } @@ -349,11 +521,11 @@ } -int Worldline::get_nelements() const { return imax_-imin_+1; } +size_t Worldline::get_nelements() const { return imax_-imin_+1; } -int Worldline::getImin() const {return imin_;} -int Worldline::getImax() const {return imax_;} -int Worldline::getI0() const {return i0_;} +size_t Worldline::getImin() const {return imin_;} +size_t Worldline::getImax() const {return imax_;} +size_t Worldline::getI0() const {return i0_;} void Worldline::get_t(double *dest) const { memcpy(dest, x0_+imin_, sizeof(double)*(imax_-imin_+1)); } @@ -404,7 +576,9 @@ case GYOTO_COORDKIND_CARTESIAN: x1=x; x2=y; x3=z; break; - default: Gyoto::throwError("in Worldline::get_xyz: unknown coordinate kind"); + default: + Gyoto::throwError("in Worldline::get_xyz: unknown coordinate kind"); + x1=x2=x3=NULL; // fix warning } getCoord(dates, n_dates, x1, x2, x3, x0dot, x1dot, x2dot, x3dot); @@ -462,6 +636,7 @@ delete [] x2dot; delete [] x3dot; } + void Worldline::getCoord(double const * const dates, size_t const n_dates, double * const x1, double * const x2, double * const x3, @@ -494,6 +669,11 @@ if (x1dot) x1dot[di] = x1dot_[imax_]; if (x2dot) x2dot[di] = x2dot_[imax_]; if (x3dot) x3dot[di] = x3dot_[imax_]; + if (metric_->getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ + double pos[8]={0.,0.,x2[di],x3[di],0.,0.,x2dot[di],0.}; + checkPhiTheta(pos); + x2[di]=pos[2];x3[di]=pos[3];x2dot[di]=pos[6]; + } continue; } else if (date > x0_[imax_]) { curl=imax_; // current imax_ @@ -533,7 +713,12 @@ if (x0dot) x0dot[di] = x0dot_[curl]; if (x1dot) x1dot[di] = x1dot_[curl]; if (x2dot) x2dot[di] = x2dot_[curl]; - if (x3dot) x3dot[di] = x3dot_[curl]; + if (x3dot) x3dot[di] = x3dot_[curl]; + if (metric_->getCoordKind() == GYOTO_COORDKIND_SPHERICAL){ + double pos[8]={0.,0.,x2[di],x3[di],0.,0.,x2dot[di],0.}; + checkPhiTheta(pos); + x2[di]=pos[2];x3[di]=pos[3];x2dot[di]=pos[6]; + } continue; } @@ -547,10 +732,12 @@ dtaul=tauprimel*dtl+0.5*tausecond*dtl*dtl; dtauh=tauprimeh*dth+0.5*tausecond*dth*dth; +# if GYOTO_DEBUG_ENABLED GYOTO_DEBUG << "curl=" << curl << ", x0_[curl]=" << x0_[curl] << ", curh=" << curh << ", x0_[curh]=" << x0_[curh] < myrk4(this, besth, dtauh, resh); - if (debug()) { - cerr << "DEBUG: Worldline::getCoord(): bestl=["<SysPrimeToTdot(pos, vel); @@ -669,23 +863,17 @@ } /* For spherical-like coordinates, - transforms theta and phi in coord1,2 so that + transforms theta and phi so that theta is in [0,pi] and phi in [0,2pi] - Important for e.g. circular velocity computation for thin disk + This call is due to interpolation above + that could lead theta,phi out of their + correct ranges. */ if (metric_->getCoordKind() == GYOTO_COORDKIND_SPHERICAL - && x2 && x3){ - double thetatmp=x2[di], phitmp=x3[di]; - while (thetatmp>M_PI) thetatmp-=2.*M_PI; - while (thetatmp<-M_PI) thetatmp+=2.*M_PI;//then theta in [-pi,pi] - if (thetatmp<0.) { - thetatmp=-thetatmp;//then theta in [0,pi] - phitmp+=M_PI;//thus, same point x,y,z - } - while (phitmp>2.*M_PI) phitmp-=2.*M_PI; - while (phitmp<0.) phitmp+=2.*M_PI;//then phi in [0,2pi] - x2[di]=thetatmp; - x3[di]=phitmp; + && x2 && x3 && x2dot){ + double pos[8]={0.,0.,x2[di],x3[di],0.,0.,x2dot[di],0.}; + checkPhiTheta(pos); + x2[di]=pos[2];x3[di]=pos[3];x2dot[di]=pos[6]; } } @@ -703,6 +891,34 @@ memcpy(x3dest, x3_+imin_, sizeof(double)*ncomp); } +void Worldline::checkPhiTheta(double coord[8]) const{ + switch (metric_ -> getCoordKind()) { + case GYOTO_COORDKIND_SPHERICAL: + { + /* Transforms theta and phi in coord so that + theta is in [0,pi] and phi in [0,2pi] */ + double thetatmp=coord[2], phitmp=coord[3]; + while (thetatmp>M_PI) thetatmp-=2.*M_PI; + while (thetatmp<-M_PI) thetatmp+=2.*M_PI;//then theta in [-pi,pi] + if (thetatmp<0.) { + thetatmp*=-1.;//then theta in [0,pi] + coord[6]*=-1.; //theta -> -theta then idem for derivative + phitmp+=M_PI;//thus, same point x,y,z + } + while (phitmp>2.*M_PI) phitmp-=2.*M_PI; + while (phitmp<0.) phitmp+=2.*M_PI;//then phi in [0,2pi] + coord[2]=thetatmp; + coord[3]=phitmp; + } + break; + case GYOTO_COORDKIND_CARTESIAN: + throwError("Worldline::checkPhiTheta(): should not be called " + "with cartesian-like coordinates"); + default: + throwError("Worldline::checkPhiTheta(): unknown COORDKIND"); + } +} + void Worldline::get_dot(double *x0dest, double *x1dest, double *x2dest, double *x3dest) const { // if (sysco!=sys_) // Gyoto::throwError("At this point, coordinate conversion is not implemented"); @@ -845,9 +1061,23 @@ void Worldline::setDelta(const double del) { delta_=del; } +void Worldline::setDelta(double d, const string &unit) { + setDelta(Units::ToGeometrical(d, unit, metric_)); +} + +double Worldline::getDelta() const { return delta_; } +double Worldline::getDelta(const string &unit) const { + return Units::FromGeometrical(getDelta(), unit, metric_); +} + +double Worldline::getTmin() const { return tmin_; } +void Worldline::setTmin(double tmin) { tmin_ = tmin; } + +void Worldline::adaptive(bool mode) { adaptive_ = mode; } +bool Worldline::adaptive() const { return adaptive_; } -double Worldline::getTlim() const { return tlim_; } -void Worldline::setTlim(double tlim) { tlim_ = tlim; } +void Worldline::maxiter(size_t miter) { maxiter_ = miter; } +size_t Worldline::maxiter() const { return maxiter_; } double const * Worldline::getCst() const { return cst_; diff -Nru gyoto-0.0.3/lib/WorldlineIntegState.C gyoto-0.1.0/lib/WorldlineIntegState.C --- gyoto-0.0.3/lib/WorldlineIntegState.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/lib/WorldlineIntegState.C 2013-07-27 09:14:20.000000000 +0000 @@ -20,7 +20,7 @@ #include "GyotoUtils.h" #include #include -#include +#include #include #include #include @@ -29,13 +29,12 @@ using namespace std ; using namespace Gyoto; -WorldlineIntegState::WorldlineIntegState(){}//seems necessary for Kerr::IntegInit, I don't see why - -WorldlineIntegState::WorldlineIntegState(SmartPointer gg, +Worldline::IntegState::IntegState(Worldline * line, const double coord[8], const double delta) : - gg_(gg), + line_(line), + gg_(line->getMetric()), delta_(delta), - deltainit_(delta) + adaptive_(line->adaptive()) { short i; for (i=0;i<8;++i) coord_[i]=coord[i]; @@ -44,96 +43,44 @@ } -int WorldlineIntegState::nextStep(Worldline* line, double coord[8], double del) { - +int Worldline::IntegState::nextStep(double coord[8]) { int j; - int coutcoord=0;//to display coordinates updated values - int coutnormdel=0;//to display new norm and integ step + double h1; - if (coutcoord){ - cout << "previous coord in Wl ada= " ; - for (int ii=0;ii<8;ii++) cout << setprecision(10) << coord_[ii] << " "; - cout << endl; - } - - if (!del){ - if (gg_ -> myrk4_adaptive(line,coord_,norm_,normref_,coordnew_,delta_,h1_)) return 1; - if (coutcoord){ - cout << "coordnew in Wl ada= " ; - for (int ii=0;ii<8;ii++) cout << setprecision(10) << coordnew_[ii] << " "; - cout << endl; - } - if (coutnormdel){ - cout << "norm apres RK ada= " << gg_ -> ScalarProd(coordnew_,coordnew_+4,coordnew_+4) << endl; - cout << "pas apres RK ada= " << h1_ << endl; - } - - delta_ = h1_; - - //TO USE TO OBTAIN NICE PLOTS OF ORBITS - /*double deltamax = 100.; //NB: use this if integrating orbits in weak field (far from BH). Steps would be too big to allow "proper" plots (but still they would be correct!) - - if (delta_>deltamax) { - if (debug()) cout << "NOTE: In WorldlineIntegState.C: delta_ becomes too big, reducing it to " << deltamax << endl; - delta_=deltamax; - }*/ + if (adaptive_){ + if (gg_ -> myrk4_adaptive(line_,coord_,norm_,normref_,coord,delta_,h1)) return 1; + delta_ = h1; }else{ - delta_=del; // use requested step if non-zero - - if (gg_ -> myrk4(line,coord_,delta_,coordnew_)) return 1; - - if (coutcoord){ - cout << "coordnew in Wl non ada= " ; - for (int ii=0;ii<8;ii++) cout << coordnew_[ii] << " "; - cout << endl; - } - if (coutnormdel){ - cout << "norm apres RK non ada= " << gg_ -> ScalarProd(coordnew_,coordnew_+4,coordnew_+4) << endl; - cout << "pas apres RK non ada= " << delta_ << endl; - } - } - - for (j=0;j<8;j++) { - coord_[j] = coordnew_[j]; - coord[j] = coordnew_[j]; + if (gg_ -> myrk4(line_,coord_,delta_,coord)) return 1; } + for (j=0;j<8;j++) coord_[j] = coord[j]; norm_=gg_ -> ScalarProd(coord,coord+4,coord+4); double normtol=.001; - if (fabs(norm_-normref_)>normtol) { - if (verbose() >= GYOTO_SEVERE_VERBOSITY){ - cerr << "***WARNING: in WlIntegState.C: norm is drifting" - " - with norm,x1,x2,x3= " << norm_ << " " << coord[1] - << " " << coord[2] << " " << coord[3] << " " << endl; - } - } - - if (delta_==delta_+1) return 1; // delta == Infinity : stop condition + /* + NB: following test done for norm/tdot + as tdot can diverge close to horizon (it's the case for + NS integration eg where geodesic can come close to horizon) + Then just check that norm/tdot does not diverge. + */ + if (fabs(norm_-normref_)/(coord[4]*coord[4])>normtol) { + GYOTO_SEVERE << + "in Worldline::IntegState.C: " + "norm is drifting" + " - with norm/x0dot**2,x1,x2,x3= " << norm_ << " " << coord[1] + << " " << coord[2] << " " << coord[3] << " " << endl; + } + +# if GYOTO_DEBUG_ENABLED + GYOTO_IF_DEBUG + GYOTO_DEBUG_ARRAY(coord,8); + GYOTO_DEBUG_EXPR(delta_); + GYOTO_ENDIF_DEBUG +# endif - if(debug()) { - cerr << "DEBUG: WorldlineIntegState::nextStep(): " - << "coord=[" << coord[0]; - for (int i=1; i<8; ++i) cerr << ", " << coord[i]; - cerr << "], delta="<< del << ", delta_="<, 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.1" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 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]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 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]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 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]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff -Nru gyoto-0.0.3/m4/ax_append_compile_flags.m4 gyoto-0.1.0/m4/ax_append_compile_flags.m4 --- gyoto-0.0.3/m4/ax_append_compile_flags.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ax_append_compile_flags.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,65 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) +# +# DESCRIPTION +# +# For every FLAG1, FLAG2 it is checked whether the compiler works with the +# flag. If it does, the flag is added FLAGS-VARIABLE +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. During the check the flag is always added to the +# current language's flags. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# NOTE: This macro depends on the AX_APPEND_FLAG and +# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with +# AX_APPEND_LINK_FLAGS. +# +# LICENSE +# +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 3 + +AC_DEFUN([AX_APPEND_COMPILE_FLAGS], +[AC_REQUIRE([AX_CHECK_COMPILE_FLAG]) +AC_REQUIRE([AX_APPEND_FLAG]) +for flag in $1; do + AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) +done +])dnl AX_APPEND_COMPILE_FLAGS diff -Nru gyoto-0.0.3/m4/ax_append_flag.m4 gyoto-0.1.0/m4/ax_append_flag.m4 --- gyoto-0.0.3/m4/ax_append_flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ax_append_flag.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,69 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space +# added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 2 + +AC_DEFUN([AX_APPEND_FLAG], +[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl +AS_VAR_SET_IF(FLAGS, + [case " AS_VAR_GET(FLAGS) " in + *" $1 "*) + AC_RUN_LOG([: FLAGS already contains $1]) + ;; + *) + AC_RUN_LOG([: FLAGS="$FLAGS $1"]) + AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"]) + ;; + esac], + [AS_VAR_SET(FLAGS,["$1"])]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_APPEND_FLAG diff -Nru gyoto-0.0.3/m4/ax_check_compile_flag.m4 gyoto-0.1.0/m4/ax_check_compile_flag.m4 --- gyoto-0.0.3/m4/ax_check_compile_flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ax_check_compile_flag.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,72 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 2 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff -Nru gyoto-0.0.3/m4/ax_pthread.m4 gyoto-0.1.0/m4/ax_pthread.m4 --- gyoto-0.0.3/m4/ax_pthread.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ax_pthread.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,309 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 18 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + ax_cv_PTHREAD_PRIO_INHERIT, [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff -Nru gyoto-0.0.3/m4/libtool.m4 gyoto-0.1.0/m4/libtool.m4 --- gyoto-0.0.3/m4/libtool.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/libtool.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,7983 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _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}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _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}" + _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}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _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}" + _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}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + 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;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + 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]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_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'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _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" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _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' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _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)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _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' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _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' + _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' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _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' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _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' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _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' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _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" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _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' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _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)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _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' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _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' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _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' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _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~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _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" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _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' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _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' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $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' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _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' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + 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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _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' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + 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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _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' + _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' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _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' + _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' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + 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; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _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' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _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' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _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' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _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' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _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' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _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' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _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' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $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' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff -Nru gyoto-0.0.3/m4/ltoptions.m4 gyoto-0.1.0/m4/ltoptions.m4 --- gyoto-0.0.3/m4/ltoptions.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ltoptions.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff -Nru gyoto-0.0.3/m4/ltsugar.m4 gyoto-0.1.0/m4/ltsugar.m4 --- gyoto-0.0.3/m4/ltsugar.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ltsugar.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff -Nru gyoto-0.0.3/m4/ltversion.m4 gyoto-0.1.0/m4/ltversion.m4 --- gyoto-0.0.3/m4/ltversion.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/ltversion.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff -Nru gyoto-0.0.3/m4/lt~obsolete.m4 gyoto-0.1.0/m4/lt~obsolete.m4 --- gyoto-0.0.3/m4/lt~obsolete.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/lt~obsolete.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff -Nru gyoto-0.0.3/m4/pkg.m4 gyoto-0.1.0/m4/pkg.m4 --- gyoto-0.0.3/m4/pkg.m4 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/m4/pkg.m4 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,159 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES diff -Nru gyoto-0.0.3/missing gyoto-0.1.0/missing --- gyoto-0.0.3/missing 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/missing 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,331 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2012-01-06.13; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru gyoto-0.0.3/yorick/Makefile gyoto-0.1.0/yorick/Makefile --- gyoto-0.0.3/yorick/Makefile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -# these values filled in by yorick -batch make.i -Y_MAKEDIR= -Y_EXE= -Y_EXE_PKGS= -Y_EXE_HOME= -Y_EXE_SITE= -Y_HOME_PKG= - -# ----------------------------------------------------- optimization flags - -# options for make command line, e.g.- make COPT=-g TGT=exe -COPT=$(COPT_DEFAULT) -TGT=$(DEFAULT_TGT) - -# ------------------------------------------------ macros for this package - -include ../local_settings - -YGYOTO_C = $(shell ls *.C) -GYOTO_C = $(shell ls ../lib/*.C) -GYOTO_OBJ = $(GYOTO_C:.C=.o) -GYOTO_H = $(shell ls ../include/*.h) - -PKG_NAME=gyoto -PKG_I=gyoto.i \ - gyoto_Photon.i gyoto_Scenery.i -#gyoto_Kerr.i gyoto_Star.i gyoto_FixedStar.i gyoto_PolishDoughnut.i - -OBJS=gyoto_utils.o gyoto_Metric.o gyoto_Astrobj.o gyoto_Photon.o \ - gyoto_Scenery.o gyoto_Screen.o gyoto_Idx.o gyoto_Spectrum.o \ - gyoto_Spectrometer.o gyoto_ThinDisk.o - -# gyoto_KerrBL.o gyoto_KerrKS.o gyoto_Star.o gyoto_FixedStar.o gyoto_PolishDoughnut.o gyoto_ThinInfiniteDiskBL.o gyoto_ThinInfiniteDiskKS.o - -# change to give the executable a name other than yorick -PKG_EXENAME=yorick - -# PKG_DEPLIBS=-Lsomedir -lsomelib for dependencies of this package -PKG_DEPLIBS=-L../lib -lgyoto $(LDLIBS) -# set compiler (or rarely loader) flags specific to this package -PKG_CFLAGS= -I../include -PKG_LDFLAGS= - -# list of additional package names you want in PKG_EXENAME -# (typically Y_EXE_PKGS should be first here) -EXTRA_PKGS=$(Y_EXE_PKGS) - -# list of additional files for clean -PKG_CLEAN= - -# autoload file for this package, if any -PKG_I_START= -# non-pkg.i include files for this package, if any -PKG_I_EXTRA=gyoto_constants.i gyotoy.i - -# -------------------------------- standard targets and rules (in Makepkg) - -# set macros Makepkg uses in target and dependency names -# DLL_TARGETS, LIB_TARGETS, EXE_TARGETS -# are any additional targets (defined below) prerequisite to -# the plug-in library, archive library, and executable, respectively -PKG_I_DEPS=$(PKG_I) -Y_DISTMAKE=distmake - -include $(Y_MAKEDIR)/Make.cfg -include $(Y_MAKEDIR)/Makepkg -include $(Y_MAKEDIR)/Make$(TGT) - -# override macros Makepkg sets for rules and other macros -# Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable) -Y_HOME=$(Y_EXE_HOME) -Y_SITE=$(Y_EXE_SITE) - -# ------------begin C++ source hacks -# must use C++ to load yorick with this C++ package -# this assumes make default CXX macro points to C++ compiler -CXXFLAGS=$(CFLAGS) $(GYOTO_FLAGS) -LD_DLL=$(CXX) $(LDFLAGS) $(PLUG_SHARED) -LD_EXE=$(CXX) $(LDFLAGS) $(PLUG_EXPORT) - -# C++ has no standard file extension, supply default make rule(s) -.C.o: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< -# --------------end C++ source hacks - -# simple example: -#myfunc.o: myapi.h -# more complex example (also consider using PKG_CFLAGS above): -#myfunc.o: myapi.h myfunc.c -# $(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c - -all: gyoto_std.so - -gyoto_std.so: stdplug/gyoto_std.so - cp stdplug/gyoto_std.so ./ - -stdplug/gyoto_std.so: stdplug/*.C - cd stdplug; yorick -batch make.i; make - -../lib/$(LIBGYOTO_FILE): ../lib/*.C - cd ../lib ; make $(LIBGYOTO_FILE) - -../lib/libgyoto.a: - cd ../lib ; make libgyoto.a - -gyoto.so: gyoto.i $(OBJS) ../lib/$(LIBGYOTO_FILE) - -install:: - cd stdplug; make install - $(YNSTALL) ygyoto.h ygyoto_supplier.C $(DEST_Y_SITE)/include - $(YNSTALL) gyotoy.glade $(DEST_Y_SITE)/glade - $(YNSTALL) gyotoy.py $(DEST_Y_SITE)/python - $(YNSTALL) gyotoy $(DEST_Y_SITE)/bin - -ln $(DEST_Y_SITE)/bin/gyotoy $(DESTDIR)$(PREFIX)/bin/ - $(YNSTALL) gyotoy.1 $(DESTDIR)$(PREFIX)/share/man/man1 - -uninstall:: - cd stdplug; make uninstall - rm -f $(DEST_Y_SITE)/include/ygyoto* - rm -f $(DEST_Y_SITE)/glade/gyotoy.glade - rm -f $(DEST_Y_SITE)/python/gyotoy.py - rm -f $(DEST_Y_SITE)/bin/gyotoy - rm -f $(DESTDIR)$(PREFIX)/bin/gyotoy - rm -f $(DESTDIR)$(PREFIX)/share/man/man1/gyotoy.1 - -clean:: - cd stdplug; yorick -batch make.i; make clean - rm -f gyoto_std.so example-patterndisk.fits.gz example-patterndisk.xml - -distclean:: - cd stdplug; yorick -batch make.i; make distclean - - -.PHONY: standalone test-cppprog test-standalone test test-plugin check - -# -------------------------------------------------------- end of Makefile diff -Nru gyoto-0.0.3/yorick/Makefile.in gyoto-0.1.0/yorick/Makefile.in --- gyoto-0.0.3/yorick/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/Makefile.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,154 @@ +# these values filled in by yorick -batch make.i +Y_MAKEDIR= +Y_EXE= +Y_EXE_PKGS= +Y_EXE_HOME= +Y_EXE_SITE= +Y_HOME_PKG= + +# ----------------------------------------------------- optimization flags + +# options for make command line, e.g.- make COPT=-g TGT=exe +COPT=$(COPT_DEFAULT) -L../lib -I../include +TGT=$(DEFAULT_TGT) + +# ------------------------------------------------ macros for this package + +#include ../local_settings + +CPPFLAGS=@CPPFLAGS@ +XERCESLDFLAGS=@XERCESLDFLAGS@ +XERCESCPPFLAGS=@XERCESCPPFLAGS@ +UDUNITS_CPPFLAGS=@UDUNITS_CPPFLAGS@ +UDUNITS_LDFLAGS=@UDUNITS_LDFLAGS@ +DYLIB_VAR=@DYLIB_VAR@ +PTHREAD_CFLAGS= @PTHREAD_CFLAGS@ +PTHREAD_LIBS= @PTHREAD_LIBS@ + +YGYOTO_C = $(shell ls *.C) +GYOTO_C = $(shell ls ../lib/*.C) +GYOTO_OBJ = $(GYOTO_C:.C=.o) +GYOTO_H = $(shell ls ../include/*.h) + +PKG_NAME=gyoto +PKG_I=gyoto.i + +OBJS=gyoto_utils.o gyoto_Metric.o gyoto_Photon.o \ + gyoto_Scenery.o gyoto_Screen.o gyoto_Idx.o gyoto_Spectrum.o \ + gyoto_Astrobj.o gyoto_ThinDisk.o \ + gyoto_Spectrometer.o gyoto_SpectroComplex.o gyoto_SpectroUniform.o + +# gyoto_KerrBL.o gyoto_KerrKS.o gyoto_Star.o gyoto_FixedStar.o gyoto_PolishDoughnut.o gyoto_ThinInfiniteDiskBL.o gyoto_ThinInfiniteDiskKS.o + +# change to give the executable a name other than yorick +PKG_EXENAME=yorick + +# PKG_DEPLIBS=-Lsomedir -lsomelib for dependencies of this package +PKG_DEPLIBS=-L../lib/.libs -lgyoto $(XERCESLDFLAGS) $(PTHREAD_LIBS) +# set compiler (or rarely loader) flags specific to this package +PKG_CFLAGS= -I../include $(XERCESCPPFLAGS) $(UDUNITS_CPPFLAGS) $(PTHREAD_CFLAGS) +PKG_LDFLAGS= $(PTHREAD_CFLAGS) + +# list of additional package names you want in PKG_EXENAME +# (typically Y_EXE_PKGS should be first here) +EXTRA_PKGS=$(Y_EXE_PKGS) + +# list of additional files for clean +PKG_CLEAN= + +# autoload file for this package, if any +PKG_I_START= +# non-pkg.i include files for this package, if any +PKG_I_EXTRA=gyoto_constants.i gyotoy.i gyoto_namespace.i + +# -------------------------------- standard targets and rules (in Makepkg) + +# set macros Makepkg uses in target and dependency names +# DLL_TARGETS, LIB_TARGETS, EXE_TARGETS +# are any additional targets (defined below) prerequisite to +# the plug-in library, archive library, and executable, respectively +PKG_I_DEPS=$(PKG_I) +Y_DISTMAKE=distmake + +include $(Y_MAKEDIR)/Make.cfg +include $(Y_MAKEDIR)/Makepkg +include $(Y_MAKEDIR)/Make$(TGT) + +# override macros Makepkg sets for rules and other macros +# Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable) +Y_HOME=$(Y_EXE_HOME) +Y_SITE=$(Y_EXE_SITE) + +# Actual install directories set with ./configure --with-yorick-* +prefix=@prefix@ +exec_prefix=@exec_prefix@ +DEST_Y_HOME=$(DESTDIR)@Y_INST_HOME@ +DEST_Y_SITE=$(DESTDIR)@Y_INST_SITE@ + +# ------------begin C++ source hacks +# must use C++ to load yorick with this C++ package +# this assumes make default CXX macro points to C++ compiler +CXXFLAGS=$(CFLAGS) $(GYOTO_FLAGS) +LD_DLL=$(CXX) $(LDFLAGS) $(PLUG_SHARED) +LD_EXE=$(CXX) $(LDFLAGS) $(PLUG_EXPORT) + +# C++ has no standard file extension, supply default make rule(s) +.C.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< +# --------------end C++ source hacks + +# simple example: +#myfunc.o: myapi.h +# more complex example (also consider using PKG_CFLAGS above): +#myfunc.o: myapi.h myfunc.c +# $(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c + +DEST_PKG_INSTALLED_DIR=$(DEST_Y_SITE)/packages/installed + +all: gyoto_std.so + +gyoto_std.so: stdplug/gyoto_std.so + cp stdplug/gyoto_std.so ./ + +stdplug/gyoto_std.so: stdplug/*.C + cd stdplug; $(MAKE) + +gyoto.so: gyoto.i $(OBJS) + +check-dll: $(PKG_DLL) check.i + unset GYOTO_PLUGINS && \ + $(DYLIB_VAR)=../lib/.libs:$$$(DYLIB_VAR) \ + GYOTO_CHECK_NODISPLAY=true \ + $(Y_EXE) -i check.i + +install:: + cd stdplug; make install + $(YNSTALL) ygyoto.h ygyoto_supplier.C $(DEST_Y_SITE)/include + $(YNSTALL) gyotoy.xml $(DEST_Y_SITE)/glade + $(YNSTALL) gyotoy.png $(DEST_Y_SITE)/data + $(YNSTALL) gyotoy $(DEST_Y_SITE)/bin + -ln $(DEST_Y_SITE)/bin/gyotoy $(DESTDIR)$(prefix)/bin/ + $(YNSTALL) gyotoy.1 $(DESTDIR)$(prefix)/share/man/man1 + $(YNSTALL) gyoto.info $(DEST_PKG_INSTALLED_DIR) + +uninstall:: + cd stdplug; make uninstall + rm -f $(DEST_Y_SITE)/include/ygyoto* + rm -f $(DEST_Y_SITE)/glade/gyotoy.xml + rm -f $(DEST_Y_HOME)/bin/gyotoy + rm -f $(DESTDIR)$(exec_prefix)/bin/gyotoy + rm -f $(DESTDIR)$(prefix)/share/man/man1/gyotoy.1 + -rm -f $(DEST_PKG_INSTALLED_DIR)/gyoto.info + +clean:: + cd stdplug; yorick -batch make.i; make clean + rm -f gyoto_std.so example-patterndisk.fits.gz example-patterndisk.xml + +distclean:: + cd stdplug; yorick -batch make.i; make distclean + +%: ; + +.PHONY: standalone test-cppprog test-standalone test test-plugin check + +# -------------------------------------------------------- end of Makefile diff -Nru gyoto-0.0.3/yorick/README gyoto-0.1.0/yorick/README --- gyoto-0.0.3/yorick/README 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/README 2013-07-27 09:14:20.000000000 +0000 @@ -17,7 +17,7 @@ Macports. You can also find binaries and source code at http://yorick.sourceforge.net/ -Yorick >= 2.1.06 is needed. +Yorick >= 2.2 is needed. For the graphical user interface Gyotoy, you'll need a few additional pieces. First of all, I seriously doubt it will run under MS Windows, @@ -29,20 +29,18 @@ A collection of utilities for Yorick, distributed as yorick-yutils in many Linux distributions. Actually, only pyk.i is used in Gyotoy (so -far), and as of writting, the CVS version is required. +far). Either get yutils > 1.4.0 from e.g. http://www.maumae.net/yorick/packages/src/ or fetch pyk.i from the CVS browser at http://yorick.cvs.sourceforge.net/viewvc/*checkout*/yorick/yorick-yutils/pyk.i -PyGTK -_____ +Yorick-GY +_________ -The graphical interface is actually coded python using the pygtk -extension. So you'll need a recent version of python, PyGTK, and the -Glade library, on which PyGTK depends. -NB: the "devel" version of PyGTK is required. +The graphical interface gyotoy needs an additional Yorick plug-in, +plus the Gtk 3 library. Check README.gyotoy. 2- Building ___________ @@ -76,4 +74,4 @@ should do, too. -6 Apr 2009, Thibaut Paumard. \ No newline at end of file +5 June 2013, Thibaut Paumard. \ No newline at end of file diff -Nru gyoto-0.0.3/yorick/README.gyotoy gyoto-0.1.0/yorick/README.gyotoy --- gyoto-0.0.3/yorick/README.gyotoy 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/README.gyotoy 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,32 @@ +Running gyotoy +______________ + +Gyotoy is a small graphical user interface (a.k.a. "a toy", or GUI) to +vizualize a single geodesic (a star orbit or a photon trajectory) in a +metric. It currently supports any metric with a spherical-like +coordinate system: KerrBL spin can be set directly, and any GYOTO +Metric can be loaded from an XML description file. + +The hard work is done by the Yorick GYOTO plug-in. In addition, the +Yorick gy plug-in is needed, as well as the Gtk 3 GObject +Instrospection files. For now, you will need to compile gy from +source: + git clone git://github.com/paumard/yorick-gy.git + cd yorick-gy + yorick -batch make.i + make + make install + +The GObject Introspection files for Gtk 3 may have been packaged for +your platform. + +Under Mac OS X using macports, try: + sudo port install gtk3 + +Under a Debian or derivative GNU/Linux system: + sudo apt-get install gir1.2-gtk-3.0 + +If you get an error message in the lines of "Glib: no schemas +installed on the system", set the environment variable XDG_DATA_DIRS +in your shell (for instance in $HOME/.profile): + export XDG_DATA_DIRS=/opt/local/share diff -Nru gyoto-0.0.3/yorick/check-disk3d.i gyoto-0.1.0/yorick/check-disk3d.i --- gyoto-0.0.3/yorick/check-disk3d.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check-disk3d.i 2013-07-27 09:14:20.000000000 +0000 @@ -46,8 +46,8 @@ write, format="%s\n", " done."; screen = gyoto_Screen(metric=metric, resolution=64, - time=1000.*metric(unitlength=)/GYOTO_C, - distance=100.*metric(unitlength=), fov=30./100., + time=1000.*metric.unitlength/GYOTO_C, + distance=100.*metric.unitlength, fov=30./100., inclination=110./180.*pi, paln=pi); write, format="%s", "Attaching Disk3D to scenery..."; @@ -72,15 +72,15 @@ write, format="%s\n", " done."; write, format="%s", "Getting Disk3D..."; -pd2 = sc2(astrobj=); +pd2 = sc2.astrobj; write, format="%s\n", " done."; write, format="%s", "Comparing emissquant array..."; -if (anyof(emissquant != pd2(copyemissquant=))) error, "CHECK FAILED"; +if (anyof(emissquant != pd2.copyemissquant)) error, "CHECK FAILED"; write, format="%s\n", " done."; write, format="%s", "Comparing velocity array..."; -if (anyof(velocity != pd2(copyvelocity=))) error, "CHECK FAILED"; +if (anyof(velocity != pd2.copyvelocity)) error, "CHECK FAILED"; write, format="%s\n", " done."; /*write, format="%s", "Performing raytracing...\n"; diff -Nru gyoto-0.0.3/yorick/check-metric.i gyoto-0.1.0/yorick/check-metric.i --- gyoto-0.0.3/yorick/check-metric.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check-metric.i 2013-07-27 09:14:20.000000000 +0000 @@ -50,7 +50,7 @@ write, format="%s\n", "done."; write, format="%s", "Getting spin... "; -if (gg(spin=)!=0.9) error, "CHECK FAILED"; +if (gg.spin!=0.9) error, "CHECK FAILED"; write, format="%s\n", "done."; //write, format="%s", "Pointer to this Metric object: gg()=="; diff -Nru gyoto-0.0.3/yorick/check-patterndisk.i gyoto-0.1.0/yorick/check-patterndisk.i --- gyoto-0.0.3/yorick/check-patterndisk.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check-patterndisk.i 2013-07-27 09:14:20.000000000 +0000 @@ -33,7 +33,7 @@ write, format="%s", "Creating PatternDisk..."; pd = gyoto_PatternDisk(copyintensity=intensity, copyopacity=opacity, innerradius=3, outerradius=28, repeatphi=8, - metric=metric); + metric=metric, rmax=50); write, format="%s\n", " done."; write, format="%s\n", "Printing PatternDisk:"; @@ -41,41 +41,47 @@ write, format="%s\n", " done."; screen = gyoto_Screen(metric=metric, resolution=64, - time=1000.*metric(unitlength=)/GYOTO_C, - distance=100.*metric(unitlength=), fov=30./100., + time=1000.*metric.unitlength/GYOTO_C, + distance=100.*metric.unitlength, fov=30./100., inclination=110./180.*pi, paln=pi); write, format="%s", "Attaching PatternDisk to scenery..."; sc = gyoto_Scenery(metric=metric, screen=screen, astrobj=pd); write, format="%s\n", " done."; -write, format="%s", "Saving data to fits file..."; -pd, fitswrite="!check-patterndisk.fits.gz"; -write, format="%s\n", " done."; - -write, format="%s", "Saving scenery to XML file..."; -sc, xmlwrite="check-patterndisk.xml"; -write, format="%s\n", " done."; +if (gyoto_haveXerces()) { + write, format="%s", "Saving data to fits file..."; + pd, fitswrite="!check-patterndisk.fits.gz"; + write, format="%s\n", " done."; -write, format="%s", "Reading back scenery..."; -sc2 = gyoto_Scenery("check-patterndisk.xml"); -write, format="%s\n", " done."; + write, format="%s", "Saving scenery to XML file..."; + sc, xmlwrite="check-patterndisk.xml"; + write, format="%s\n", " done."; -write, format="%s", "Removing temporary files..."; -remove, "check-patterndisk.xml"; -remove, "check-patterndisk.fits.gz"; -write, format="%s\n", " done."; + write, format="%s", "Reading back scenery..."; + sc2 = gyoto_Scenery("check-patterndisk.xml"); + write, format="%s\n", " done."; + write, format="%s", "Removing temporary files..."; + remove, "check-patterndisk.xml"; + remove, "check-patterndisk.fits.gz"; + write, format="%s\n", " done."; + } else { + write, format="%s", "Cloning..."; + sc2 = sc.clone; + write, format="%s\n", " done."; + } + write, format="%s", "Getting PatternDisk..."; -pd2 = sc2(astrobj=); +pd2 = sc2.astrobj; write, format="%s\n", " done."; write, format="%s", "Comparing intensity array..."; -if (anyof(intensity != pd2(copyintensity=))) error, "CHECK FAILED"; +if (anyof(intensity != pd2.copyintensity)) error, "CHECK FAILED"; write, format="%s\n", " done."; write, format="%s", "Comparing opacity array..."; -if (anyof(opacity != pd2(copyopacity=))) error, "CHECK FAILED"; +if (anyof(opacity != pd2.copyopacity)) error, "CHECK FAILED"; write, format="%s\n", " done."; write, format="%s", "Performing raytracing...\n"; @@ -91,4 +97,3 @@ if (batch()) winkill; } -if (batch()) quit; diff -Nru gyoto-0.0.3/yorick/check-photon-BL.i gyoto-0.1.0/yorick/check-photon-BL.i --- gyoto-0.0.3/yorick/check-photon-BL.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check-photon-BL.i 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -23,6 +23,7 @@ aa=0.; gg=gyoto_KerrBL(spin=aa); +gg2=gg.clone; write, format="%s", "Creating Photon: "; ph = gyoto_Photon(); @@ -60,9 +61,8 @@ write, format="%s\n","done.\n"; write, format="%s\n", "Trying gyoto_Star_xFill"; -st(xfill=770); +st,xfill=770.; "done"; -gyoto_Star_xFill(st,770.); //Computing position of star at a given proper time : //time=212.4034;//proper time @@ -72,32 +72,6 @@ //if (abs(pos-[10.5718661339679, 1.57079398752261, 59.5795847453848])(max)<1e-5) // write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; -gyoto_Star_get_xyz,st,x,y; - - -gyoto_Star_get_coord, st, t, r, theta, phi; -gyoto_Star_get_dot, st, tdot, rdot, thetadot, phidot; -gyoto_Star_get_prime, st, rp, thetap, phip; - -write, format="%s", "Checking gyoto_Metric_SysPrimeToTdot: "; -tdotbis=array(double,numberof(t)); -for (n=1; n<= numberof(t); ++n) - tdotbis(n)=gg(prime2tdot= [t(n), r(n), theta(n), phi(n)], - [rp(n), thetap(n), phip(n)] - ); -if (max (abs( (tdot-tdotbis)/tdot ) ) < 2e-3) - write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; - - -write, format="%s", "Checking gyoto_Metric_g: "; -norm=array(double, numberof(t)); -for (n=1; n<= numberof(t); ++n) { - g=gg([t(n), r(n), theta(n), phi(n)]); - qvel=[tdot(n), rdot(n), thetadot(n), phidot(n)]; - norm(n)=sum(g*qvel(,-)*qvel(-,)); - } -if (max(abs(norm+1)) < 3e-3) - write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; // Ray tracing @@ -106,6 +80,7 @@ write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Metric_setSpin: "; gg,spin=0.; + write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Star(): "; orbit=gyoto_Star(metric=gg, radius=2, @@ -115,44 +90,60 @@ N=21; delta=pi/(10.*N); screen, fov=pi/10., resolution=21; -write, format="%s", "Checking gyoto_Photon_new: "; -ph=gyoto_Photon_new(); -write, format="%s\n","done.\n"; i=15; j=9; xscr=delta*(i-(N+1)/2.); yscr=delta*(j-(N+1)/2.); write, format="%s", "Checking gyoto_Photon_setInitialCondition: "; -gyoto_Photon_setInitialCondition, ph, gg, orbit, screen, -xscr, yscr; ph2=gyoto_Photon(metric=gg, astrobj=orbit); ph1=gyoto_Photon(metric=gg, astrobj=orbit); ph1, initcoord=screen, -xscr, yscr; ph2, initcoord=screen, i, j; write, format="%s\n","done.\n"; -write, format="%s", "Checking gyoto_Photon_setDelta: "; -gyoto_Photon_setDelta, ph, 1.; +write, format="%s", "Checking gyoto_Photon(delta=1): "; write, format="%s\n","done.\n"; -write, format="%s", "Checking gyoto_Photon_hit: "; -//if(gyoto_Photon_hit(ph, 0.)) -if( ph(is_hit=1) && ph1(is_hit=1) && ph2(is_hit=1)) +write, format="%s", "Checking gyoto_Photon(is_hit=1): "; +if( ph1(is_hit=1) && ph2(is_hit=1)) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; "_________________________"; hitmap2=hitmap1=hitmap=array(0, N, N); +ph=gyoto_Photon(metric=gg, astrobj=orbit); for (i=1; i<=N; i++) { write , format="*** Column %i ***\n", i; xscr=delta*(i-(N+1)/2.); for (j=1; j<=N; j++) { yscr=delta*(j-(N+1)/2.); - gyoto_Photon_setInitialCondition, ph, gg, orbit, screen, -xscr, yscr; + ph, initcoord=screen, -xscr, yscr; + ph, tmin=0.; ph1, initcoord=screen, -xscr, yscr; ph2, initcoord=screen, i, j; - gyoto_Photon_setDelta, ph, 1.; - hitmap(i,j)=gyoto_Photon_hit(ph, 0.); + ph, delta=1.; + hitmap(i,j)=ph(is_hit=1); } } +ph2=[]; + + +// Check that changing spin can be done on attached metric +ph1, metric=ph1.metric; +ph1, xfill=0.; +txyz=ph1.get_txyz; + plg, txyz(2,), txyz(1,); +ph2=ph1.clone; +gg2=gg.clone; +write, format="%s", "Mutating metric spin... "; +gg, spin=0.5; +write, format="%s\n", "done."; +gg2, spin=0.5; +ph2, metric=gg2; + + ph1=ph2=[]; + +// CLONES AND HOOKS + "_________________________"; ph=[]; @@ -162,4 +153,6 @@ gg=[]; + + write, format= "%s\n"," ALL TESTS PASSED"; diff -Nru gyoto-0.0.3/yorick/check-polish-doughnut.i gyoto-0.1.0/yorick/check-polish-doughnut.i --- gyoto-0.0.3/yorick/check-polish-doughnut.i 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/check-polish-doughnut.i 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,96 @@ +#include "gyoto.i" +#include "gyoto_std.i" + +write, format="%s", "Creating default PolishDoughnut... "; +pd = gyoto_PolishDoughnut(); +write, format="%s\n", "done."; + +write, format="%s\n", "Printing object:"; +write, format="%s\n", "-----------------------------"; +pd; +write, format="%s\n", "-----------------------------"; + +// write, format="%s", "Setting lambda to 2... "; +// pd, lambda=2; +// write, format="%s\n", "done."; + +// write, format = "%s", "Checking value of lambda... "; +// if (pd(get_lambda=1)==2) write, format="%s\n", "done."; \ +// else error, "CHECK FAILED!"; + +write, format= "%s" , "Instanciating Kerr metric... "; +gg = gyoto_KerrBL(); +write, format= "%s\n", "done."; + +write, format= "%s" , "Attaching metric to doughnut... "; +pd, metric=gg; +write, format= "%s\n", "done."; + +write, format= "%s" , "Checking attached metric... "; +if (pd.metric()==gg()) write, format="%s\n", "done."; \ + else error, "CHECK FAILED!"; + +write, format="%s\n", "Printing object:"; +write, format="%s\n", "-----------------------------"; +pd; +write, format="%s\n", "-----------------------------"; + +write, format="%s", "Creating PolishDoughnut from file... "; +pd = gyoto_Scenery("../doc/examples/example-polish-doughnut.xml").astrobj; +write, format="%s\n", "done."; + +write, format="%s\n", "Printing object:"; +write, format="%s\n", "-----------------------------"; +pd; +write, format="%s\n", "-----------------------------"; + +write, format="%s", "Reading PolishDoughnut scenery... "; +sc = gyoto_Scenery("../doc/examples/example-polish-doughnut.xml") ; +write, format="%s\n", "done."; + +write, format="%s", "Setting spectro... "; +noop, sc.screen(spectro= + gyoto_SpectroUniform(kind="freqlog", + nsamples=20, + band=[-6, 8], + unit="eV") + ); +noop, sc.astrobj(opticallythin=1); +write, format="%s\n", "done."; + +write, format="%s", "Ray-tracing scenery... "; +img = sc(,,"Spectrum")(,,avg); +write, format="%s\n", "done."; + +write, format="%s", "Displaying image... "; +fma; pli, img; +write, format="%s\n", "done."; + +pause, 1000; + +write, format="%s", "Integrating one spectrum with radiative transfer...\n"; +s1 = sc(10, 15, "Spectrum[J.m-2.s-1.sr-1.Hz-1]"); +write, format="%s\n", "done."; +midpoints = sc.screen.spectro.midpoints; +widths = sc.screen.spectro.widths; +fma; +logxy, 1, 1; +plg, (s1*widths), midpoints; +xytitles, "Frequency [Hz]"; + +write, format="%s", "Integrating one bin spectrum with radiative transfer...\n"; +s2 = sc(10, 15, "BinSpectrum[J.m-2.s-1.sr-1]"); +write, format="%s\n", "done."; +channels = sc.screen.spectro.channels; +widths = sc.screen.spectro.widths; +s22=array(double,numberof(s2)*2); +s22(::2)=s2; s22(2::2)=s2; +chan2=array(double,numberof(s2)*2); +chan2(::2)=channels(1,); chan2(2::2)=channels(2,); +plg, s22, chan2; + +if (batch()) { + pause, 1000; + winkill,0; + } +write, format= "%s\n"," POLISHDOUGHNUT TESTS PASSED"; diff -Nru gyoto-0.0.3/yorick/check-scenery.i gyoto-0.1.0/yorick/check-scenery.i --- gyoto-0.0.3/yorick/check-scenery.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check-scenery.i 2013-07-27 09:14:20.000000000 +0000 @@ -20,7 +20,11 @@ #include "gyoto.i" #include "gyoto_std.i" -if (get_env("GYOTO_CHECK_NODISPLAY")) fma=winkill=pli = noop; +// From yutils, for tic() and tac() +#include "util_fr.i" + +if (get_env("GYOTO_CHECK_NODISPLAY")) + window = pause = fma = winkill = pli = plg = noop; write, format="%s", "New scenery... "; sc=gyoto_Scenery(); @@ -49,7 +53,7 @@ write, format="%i\n", sc(get_pointer=1); write, format="%s", "Creating star... "; -ao=gyoto_Star(metric=sc(metric=), radius=0.5, +ao=gyoto_Star(metric=sc.metric, radius=0.5, initcoord=[0,6,pi/2.,0], [0,1e-3,0]); write, format="%s\n", "done."; @@ -58,13 +62,13 @@ write, format="%s\n", "done."; write, format="%s", "Retrieving astrobj... "; -ao2=sc(astrobj=); +ao2=sc.astrobj; write, format="%s\n", "done."; write, format="%s", "Setting time... "; -noop,sc(screen=)(time=10000); +noop,sc.screen(time=10000); write, format="%s\n", "done."; -write, format="%s %e\n", "Checking time:", (time=sc(screen=)(time=)); +write, format="%s %e\n", "Checking time:", (time=sc.screen.time); if (time!=10000) error, "CHECK FAILED"; // write, format="%s", "Setting tmin... "; @@ -82,42 +86,88 @@ write, format="%s", "Setting field-of-view... "; -noop,sc(screen=)(fov=pi/4.); +noop,sc.screen(fov=pi/4.); write, format="%s\n", "done."; -write, format="%s %e\n", "Checking field-of-view:", (fov=sc(screen=)(fov=)); +write, format="%s %e\n", "Checking field-of-view:", (fov=sc.screen.fov); if (fov!=pi/4) error, "CHECK FAILED"; write, format="%s", "Setting resolution... "; -noop,sc(screen=)(resolution=16); +noop,sc.screen(resolution=16); write, format="%s\n", "done."; -write, format="%s %i\n", "Checking resolution:", (res=sc(screen=)(resolution=)); +write, format="%s %i\n", "Checking resolution:", (res=sc.screen.resolution); if (res!=16) error, "CHECK FAILED"; write, format="%s", "Setting inclination... "; -noop,sc(screen=)(inclination=pi/3.); +noop,sc.screen(inclination=pi/3.); write, format="%s\n", "done."; write, format="%s %e\n", "Checking inclination:", - (incl=sc(screen=)(inclination=)); + (incl=sc.screen.inclination); if (incl!=pi/3) error, "CHECK FAILED"; +if (gyoto_haveXerces()) { + write, format="%s", "Writing XML description... "; + sc,xmlwrite="test.xml"; + write, format="%s\n", "done."; + remove, "test.xml"; + + write , format="%s", "Reading Scenery from XML description... "; + sc3=gyoto_Scenery("../doc/examples/example-moving-star.xml"); + } else { + write , format="%s", "No Xerces, creating scenery from scratch... "; + gg = gyoto_KerrBL(); + spectro = gyoto_Spectrometer(kind="wave", nsamples=1, band=[2e-6, 2.4e-6]); + scr = gyoto_Screen(metric=gg, + observerpos=[1000., 100., 0.78, 0. ], + time=1000., + resolution=128, + spectro=spectro); + ao = gyoto_Star(metric=gg, radius=2, rmax=50, + initcoord=[600,9,1.5707999999999999741,0],[0., 0., 0.037037]) + sc3=gyoto_Scenery(metric=gyoto_KerrBL(), + screen=scr, + astrobj=ao, + tmin=0.); + } +noop, sc3.screen(resolution=32); +noop, sc3.astrobj(radius=2); +write, format="%s\n" , "done."; -write, format="%s", "Writing XML description... "; -sc,xmlwrite="test.xml"; -write, format="%s\n", "done."; -remove, "test.xml"; +write, format="%s", "Ray-tracing on 1 thread (sc())... \n"; +sc3, nthreads=1; +tic; +im1 = sc3(,,"Intensity"); // raytrace +tac(); +pli, im1; +pause, 1000; +write, format="%s\n" , "done."; -write , format="%s", "Reading Scenery from XML description... "; -sc3=gyoto_Scenery("../doc/examples/example-moving-star.xml"); -noop, sc3(screen=)(resolution=32); -noop, sc3(astrobj=)(radius=2); +write, format="%s", "Ray-tracing on 2 threads (sc())... \n"; +sc3, nthreads=2; +tic; +im1 = sc3(,,"Intensity"); // raytrace +tac(); +window,1; pli, im1; +pause, 1000; write, format="%s\n" , "done."; -write, format="%s", "Ray-tracing... "; -pli, sc3(,,"Intensity"); // raytrace +write, format="%s", "Ray-tracing on 2 threads (gyoto_Scenery_rayTrace())... \n"; +sc3, nthreads=2, quantities="Intensity"; +//tic; +im1 = gyoto_Scenery_rayTrace(sc3); +window,2; pli, im1; pause, 1000; +//tac(); write, format="%s\n" , "done."; +write, format="%s", "Ray-tracing on 1 thread... \n"; +sc3, nthreads=1; +tic; +im1 = gyoto_Scenery_rayTrace(sc3); +tac(); +write, format="%s\n" , "done."; + + /* write, format="%s", "Ray-tracing on adaptive grid... "; data = gyoto_Scenery_adaptive_raytrace(sc3, 4); fma; @@ -125,14 +175,14 @@ write, format="%s\n" , "done."; */ write, format="%s", "Cloning..."; -sc4=sc3(clone=); +sc4=sc3.clone; write, format="%s\n", "DONE."; write, format="%s\n", "Printing clone:"; sc4; ph = gyoto_Photon(initcoord=sc3, 6, 19); -ph(is_hit=); +ph.is_hit; if (batch()) { diff -Nru gyoto-0.0.3/yorick/check-star.i gyoto-0.1.0/yorick/check-star.i --- gyoto-0.0.3/yorick/check-star.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check-star.i 2013-07-27 09:14:20.000000000 +0000 @@ -28,7 +28,7 @@ st; write, format="%s", "Cloning..."; -st2=st(clone=); +st2=st.clone; write, format="%s\n", "DONE."; write, format="%s", "Printing clone:"; @@ -41,7 +41,7 @@ write, format= "%s\n", "done."; write, format="%s", "Getting radius... "; -if (st(radius=)!=0.5) error, "CHECK FAILED"; +if (st.radius!=0.5) error, "CHECK FAILED"; write, format= "%s\n", "done."; write, format="%s", "Setting metric... "; @@ -49,10 +49,10 @@ write, format= "%s\n", "done."; write, format="%s", "Changing metric spin... "; -rien=st(metric=)(spin=0.7); -if (st(metric=)(spin=)!=0.7) error, "CHECK FAILED"; -gg=st(metric=); gg, spin=0.995; -if (st(metric=)(spin=)!=0.995) error, "CHECK FAILED"; +noop, st.metric(spin=0.7); +if (st.metric.spin!=0.7) error, "CHECK FAILED"; +gg=st.metric; gg, spin=0.995; +if (st.metric.spin!=0.995) error, "CHECK FAILED"; write, format= "%s\n", "done."; write, format="%s", "Setting initial condition... "; @@ -64,7 +64,7 @@ write, format="%s\n", "done."; write, format="%s", "Instanciating Screen... "; -screen=gyoto_Screen(metric=st(metric=)); +screen=gyoto_Screen(metric=st.metric); write, format="%s\n", "done."; diff -Nru gyoto-0.0.3/yorick/check.i gyoto-0.1.0/yorick/check.i --- gyoto-0.0.3/yorick/check.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/check.i 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -18,7 +18,11 @@ */ // NODISPLAY implies batch mode -if (get_env("GYOTO_CHECK_NODISPLAY")) batch, 1; +if (get_env("GYOTO_CHECK_NODISPLAY")) { + batch, 1; + __xytitles=xytitles; __fma=fma; __winkill=winkill; __pli=pli; __plg=plg; + xytitles = fma = winkill = pli = plg = noop; + } #include "gyoto.i" #include "gyoto_std.i" @@ -50,7 +54,7 @@ write, format="%s\n","done.\n"; write, format="%s\n", "Trying gyoto_Star_xFill"; -gyoto_Star_xFill(st,770.); +st,xfill=770.; //Computing position of star at a given proper time : //time=212.4034;//proper time @@ -60,27 +64,25 @@ //if (abs(pos-[10.5718661339679, 1.57079398752261, 59.5795847453848])(max)<1e-5) // write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; -gyoto_Star_get_xyz,st,x,y; - - -gyoto_Star_get_coord, st, t, r, theta, phi; -gyoto_Star_get_dot, st, tdot, rdot, thetadot, phidot; -gyoto_Star_get_prime, st, rp, thetap, phip; +txyz=st.get_txyz; dates=txyz(,1); x=txyz(,2); y=txyz(,3); +coords=st.get_coord; +primes=st.get_prime; write, format="%s", "Checking gg(prime2tdot= pos, vel): "; -tdotbis=array(double,numberof(t)); -for (n=1; n<= numberof(t); ++n) - tdotbis(n)=gg (prime2tdot=[t(n), r(n), theta(n), phi(n)], - [rp(n), thetap(n), phip(n)]); +N=dimsof(coords)(2); +tdotbis=array(double,N); +for (n=1; n<= N; ++n) + tdotbis(n)=gg (prime2tdot=coords(n,1:4), primes(n,)); +tdot=coords(,5); if (max (abs( (tdot-tdotbis)/tdot ) ) < 1e-4) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; write, format="%s", "Checking gg(position): "; -norm=array(double, numberof(t)); -for (n=1; n<= numberof(t); ++n) { - g = gg ([t(n), r(n), theta(n), phi(n)]); - qvel=[tdot(n), rdot(n), thetadot(n), phidot(n)]; +norm=array(double, N); +for (n=1; n<= N; ++n) { + g = gg (coords(n,)); + qvel=coords(n,5:); norm(n)=sum(g*qvel(,-)*qvel(-,)); } if (max(abs(norm+1)) < 1e-4) @@ -101,8 +103,8 @@ N=51; delta=pi/(10.*N); -write, format="%s", "Checking gyoto_Photon_new: "; -ph=gyoto_Photon_new(); +write, format="%s", "Checking gyoto_Photon(): "; +ph=gyoto_Photon(); write, format="%s\n","done.\n"; i=35; j=19; @@ -110,27 +112,28 @@ yscr=delta*(j-(N+1)/2.); write, format="%s", "Checking gyoto_Photon_setInitialCondition: "; -gyoto_Photon_setInitialCondition, ph, gg, orbit, screen, -xscr, yscr; +ph, metric=gg, astrobj=orbit, initcoord=screen, -xscr, yscr; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Photon_setDelta: "; -gyoto_Photon_setDelta, ph, 1.; +ph, delta=1.; write, format="%s\n","done.\n"; write, format="%s", "Checking gyoto_Photon_hit: "; -if(gyoto_Photon_hit(ph, 0.)) +if(ph(is_hit=1)) write, format="%s\n","done.\n"; else error, "PREVIOUS CHECK FAILED"; "_________________________"; hitmap=array(0, N, N); +ph, tmin=0.; for (i=1; i<=N; i++) { write , format="*** Column %i ***\n", i; xscr=delta*(i-(N+1)/2.); for (j=1; j<=N; j++) { yscr=delta*(j-(N+1)/2.); - gyoto_Photon_setInitialCondition, ph, gg, orbit, screen, -xscr, yscr; + ph, metric=gg, astrobj=orbit, initcoord=screen, -xscr, yscr; // gyoto_Photon_setDelta, ph, 1.; - hitmap(i,j)=gyoto_Photon_hit(ph, 0.); + hitmap(i,j)=ph(is_hit=1); } } "_________________________"; @@ -149,6 +152,12 @@ #include "check-star.i" #include "check-scenery.i" #include "check-patterndisk.i" +#include "check-polish-doughnut.i" + +write, format="\n\n%s\n%s\n%s\n", + " ********************************************", + " * ALL TESTS PASSED *", + " ********************************************"; if (anyof(get_argv() == "check.i")) quit; //if (batch()) quit; diff -Nru gyoto-0.0.3/yorick/config.log gyoto-0.1.0/yorick/config.log --- gyoto-0.0.3/yorick/config.log 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/config.log 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,553 @@ + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by gyoto config.status 0.0.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on b-wing + +config.status:1133: creating Makefile +config.status:1119: error: cannot find input file: `bin/Makefile.in' + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_c_compiler_gnu=yes +ac_cv_cxx_compiler_gnu=yes +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXCPP_set= +ac_cv_env_CXXCPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_func_dlopen=no +ac_cv_func_floor=yes +ac_cv_func_getcwd=yes +ac_cv_func_pow=yes +ac_cv_func_shl_load=no +ac_cv_func_sqrt=yes +ac_cv_func_strdup=yes +ac_cv_func_strtod=yes +ac_cv_header_dlfcn_h=yes +ac_cv_header_float_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_stdbool_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stddef_h=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_lib_dl_dlopen=yes +ac_cv_lib_dld_shl_load=no +ac_cv_lib_error_at_line=yes +ac_cv_objext=o +ac_cv_path_EGREP='/bin/grep -E' +ac_cv_path_FGREP='/bin/grep -F' +ac_cv_path_GREP=/bin/grep +ac_cv_path_SED=/bin/sed +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=mawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_CXXCPP='g++ -E' +ac_cv_prog_YORICK=yorick +ac_cv_prog_ac_ct_AR=ar +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_CXX=g++ +ac_cv_prog_ac_ct_MANIFEST_TOOL=mt +ac_cv_prog_ac_ct_OBJDUMP=objdump +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_ac_ct_STRIP=strip +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_cxx_g=yes +ac_cv_prog_make_make_set=yes +ac_cv_type__Bool=no +ac_cv_type_size_t=yes +am_cv_CC_dependencies_compiler_type=gcc3 +am_cv_CXX_dependencies_compiler_type=gcc3 +lt_cv_ar_at_file=@ +lt_cv_archive_cmds_need_lc=no +lt_cv_deplibs_check_method=pass_all +lt_cv_dlopen=dlopen +lt_cv_dlopen_libs=-ldl +lt_cv_dlopen_self=yes +lt_cv_dlopen_self_static=no +lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_ld_reload_flag=-r +lt_cv_nm_interface='BSD nm' +lt_cv_objdir=.libs +lt_cv_path_LD=/usr/bin/ld +lt_cv_path_LDCXX='/usr/bin/ld -m elf_x86_64' +lt_cv_path_NM='/usr/bin/nm -B' +lt_cv_path_mainfest_tool=no +lt_cv_prog_compiler_c_o=yes +lt_cv_prog_compiler_c_o_CXX=yes +lt_cv_prog_compiler_pic='-fPIC -DPIC' +lt_cv_prog_compiler_pic_CXX='-fPIC -DPIC' +lt_cv_prog_compiler_pic_works=yes +lt_cv_prog_compiler_pic_works_CXX=yes +lt_cv_prog_compiler_rtti_exceptions=no +lt_cv_prog_compiler_static_works=yes +lt_cv_prog_compiler_static_works_CXX=yes +lt_cv_prog_gnu_ld=yes +lt_cv_prog_gnu_ldcxx=yes +lt_cv_sharedlib_from_linklib_cmd='printf %s\n' +lt_cv_shlibpath_overrides_runpath=no +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_max_cmd_len=1572864 +lt_cv_to_host_file_cmd=func_convert_file_noop +lt_cv_to_tool_file_cmd=func_convert_file_noop + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='$${TAR-tar}' +AR='ar' +AUTOCONF='${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf' +AUTOHEADER='${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader' +AUTOMAKE='${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11' +AWK='mawk' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFITSIOCPPFLAGS='' +CFITSIOLDFLAGS=' -lcfitsio' +CFLAGS='-g -O2' +CPP='gcc -E' +CPPFLAGS='' +CXX='g++' +CXXCPP='g++ -E' +CXXDEPMODE='depmode=gcc3' +CXXFLAGS='-g -O2' +CYGPATH_W='echo' +DEFS='-DHAVE_CONFIG_H' +DEPDIR='.deps' +DLLTOOL='false' +DSYMUTIL='' +DUMPBIN='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/bin/grep -E' +EXEEXT='' +FGREP='/bin/grep -F' +GREP='/bin/grep' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LD='/usr/bin/ld -m elf_x86_64' +LDFLAGS='' +LIBOBJS='' +LIBS='-ldl ' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIPO='' +LN_S='ln -s' +LTLIBOBJS='' +MAKEINFO='${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo' +MANIFEST_TOOL=':' +MKDIR_P='/bin/mkdir -p' +NM='/usr/bin/nm -B' +NMEDIT='' +OBJDUMP='objdump' +OBJEXT='o' +OTOOL64='' +OTOOL='' +PACKAGE='gyoto' +PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' +PACKAGE_NAME='gyoto' +PACKAGE_STRING='gyoto 0.0.4' +PACKAGE_TARNAME='gyoto' +PACKAGE_URL='' +PACKAGE_VERSION='0.0.4' +PATH_SEPARATOR=':' +POW_LIB='' +RANLIB='ranlib' +SED='/bin/sed' +SET_MAKE='' +SHELL='/bin/bash' +STRIP='strip' +VERSION='0.0.4' +XERCESCPPFLAGS='' +XERCESLDFLAGS=' -lxerces-c' +YORICK='yorick' +ac_ct_AR='ar' +ac_ct_CC='gcc' +ac_ct_CXX='g++' +ac_ct_DUMPBIN='' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='#' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__fastdepCXX_FALSE='#' +am__fastdepCXX_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__nodep='_no' +am__quote='' +am__tar='$${TAR-tar} chof - "$$tardir"' +am__untar='$${TAR-tar} xf -' +bindir='${exec_prefix}/bin' +build='x86_64-unknown-linux-gnu' +build_alias='' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='unknown' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host='x86_64-unknown-linux-gnu' +host_alias='' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='unknown' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} /home/thibaut/git/Gyoto/install-sh' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +plugin_sfx='so' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sovers='0.0.0' +sysconfdir='${prefix}/etc' +target_alias='' +use_cfitsio='-DGYOTO_USE_CFITSIO' +use_xerces='-DGYOTO_USE_XERCES' + +configure: exit 1 + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by gyoto config.status 0.0.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on b-wing + +config.status:1133: creating Makefile +config.status:1119: error: cannot find input file: `bin/Makefile.in' + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_c_compiler_gnu=yes +ac_cv_cxx_compiler_gnu=yes +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXCPP_set= +ac_cv_env_CXXCPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_func_dlopen=no +ac_cv_func_floor=yes +ac_cv_func_getcwd=yes +ac_cv_func_pow=yes +ac_cv_func_shl_load=no +ac_cv_func_sqrt=yes +ac_cv_func_strdup=yes +ac_cv_func_strtod=yes +ac_cv_header_dlfcn_h=yes +ac_cv_header_float_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_stdbool_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stddef_h=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_lib_dl_dlopen=yes +ac_cv_lib_dld_shl_load=no +ac_cv_lib_error_at_line=yes +ac_cv_objext=o +ac_cv_path_EGREP='/bin/grep -E' +ac_cv_path_FGREP='/bin/grep -F' +ac_cv_path_GREP=/bin/grep +ac_cv_path_SED=/bin/sed +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=mawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_CXXCPP='g++ -E' +ac_cv_prog_YORICK=yorick +ac_cv_prog_ac_ct_AR=ar +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_CXX=g++ +ac_cv_prog_ac_ct_MANIFEST_TOOL=mt +ac_cv_prog_ac_ct_OBJDUMP=objdump +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_ac_ct_STRIP=strip +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_cxx_g=yes +ac_cv_prog_make_make_set=yes +ac_cv_type__Bool=no +ac_cv_type_size_t=yes +am_cv_CC_dependencies_compiler_type=gcc3 +am_cv_CXX_dependencies_compiler_type=gcc3 +lt_cv_ar_at_file=@ +lt_cv_archive_cmds_need_lc=no +lt_cv_deplibs_check_method=pass_all +lt_cv_dlopen=dlopen +lt_cv_dlopen_libs=-ldl +lt_cv_dlopen_self=yes +lt_cv_dlopen_self_static=no +lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_ld_reload_flag=-r +lt_cv_nm_interface='BSD nm' +lt_cv_objdir=.libs +lt_cv_path_LD=/usr/bin/ld +lt_cv_path_LDCXX='/usr/bin/ld -m elf_x86_64' +lt_cv_path_NM='/usr/bin/nm -B' +lt_cv_path_mainfest_tool=no +lt_cv_prog_compiler_c_o=yes +lt_cv_prog_compiler_c_o_CXX=yes +lt_cv_prog_compiler_pic='-fPIC -DPIC' +lt_cv_prog_compiler_pic_CXX='-fPIC -DPIC' +lt_cv_prog_compiler_pic_works=yes +lt_cv_prog_compiler_pic_works_CXX=yes +lt_cv_prog_compiler_rtti_exceptions=no +lt_cv_prog_compiler_static_works=yes +lt_cv_prog_compiler_static_works_CXX=yes +lt_cv_prog_gnu_ld=yes +lt_cv_prog_gnu_ldcxx=yes +lt_cv_sharedlib_from_linklib_cmd='printf %s\n' +lt_cv_shlibpath_overrides_runpath=no +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_max_cmd_len=1572864 +lt_cv_to_host_file_cmd=func_convert_file_noop +lt_cv_to_tool_file_cmd=func_convert_file_noop + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='$${TAR-tar}' +AR='ar' +AUTOCONF='${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf' +AUTOHEADER='${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader' +AUTOMAKE='${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11' +AWK='mawk' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFITSIOCPPFLAGS='' +CFITSIOLDFLAGS=' -lcfitsio' +CFLAGS='-g -O2' +CPP='gcc -E' +CPPFLAGS='' +CXX='g++' +CXXCPP='g++ -E' +CXXDEPMODE='depmode=gcc3' +CXXFLAGS='-g -O2' +CYGPATH_W='echo' +DEFS='-DHAVE_CONFIG_H' +DEPDIR='.deps' +DLLTOOL='false' +DSYMUTIL='' +DUMPBIN='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/bin/grep -E' +EXEEXT='' +FGREP='/bin/grep -F' +GREP='/bin/grep' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LD='/usr/bin/ld -m elf_x86_64' +LDFLAGS='' +LIBOBJS='' +LIBS='-ldl ' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIPO='' +LN_S='ln -s' +LTLIBOBJS='' +MAKEINFO='${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo' +MANIFEST_TOOL=':' +MKDIR_P='/bin/mkdir -p' +NM='/usr/bin/nm -B' +NMEDIT='' +OBJDUMP='objdump' +OBJEXT='o' +OTOOL64='' +OTOOL='' +PACKAGE='gyoto' +PACKAGE_BUGREPORT='gyoto@sympa.obspm.fr' +PACKAGE_NAME='gyoto' +PACKAGE_STRING='gyoto 0.0.4' +PACKAGE_TARNAME='gyoto' +PACKAGE_URL='' +PACKAGE_VERSION='0.0.4' +PATH_SEPARATOR=':' +POW_LIB='' +RANLIB='ranlib' +SED='/bin/sed' +SET_MAKE='' +SHELL='/bin/bash' +STRIP='strip' +SUBDIRS='lib bin doc yorick' +VERSION='0.0.4' +XERCESCPPFLAGS='' +XERCESLDFLAGS=' -lxerces-c' +YORICK='yorick' +ac_ct_AR='ar' +ac_ct_CC='gcc' +ac_ct_CXX='g++' +ac_ct_DUMPBIN='' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='#' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__fastdepCXX_FALSE='#' +am__fastdepCXX_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__nodep='_no' +am__quote='' +am__tar='$${TAR-tar} chof - "$$tardir"' +am__untar='$${TAR-tar} xf -' +bindir='${exec_prefix}/bin' +build='x86_64-unknown-linux-gnu' +build_alias='' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='unknown' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host='x86_64-unknown-linux-gnu' +host_alias='' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='unknown' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} /home/thibaut/git/Gyoto/install-sh' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +plugin_sfx='so' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sovers='0.0.0' +sysconfdir='${prefix}/etc' +target_alias='' +use_cfitsio='-DGYOTO_USE_CFITSIO' +use_xerces='-DGYOTO_USE_XERCES' + +configure: exit 1 diff -Nru gyoto-0.0.3/yorick/config.status gyoto-0.1.0/yorick/config.status --- gyoto-0.0.3/yorick/config.status 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/config.status 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,2266 @@ +#! /bin/bash +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/bash} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by gyoto $as_me 0.0.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile bin/Makefile doc/Makefile lib/Makefile yorick/Makefile" +config_headers=" config.h" +config_commands=" depfiles libtool" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +ac_cs_config="" +ac_cs_version="\ +gyoto config.status 0.0.4 +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/thibaut/git/Gyoto' +srcdir='.' +INSTALL='/usr/bin/install -c' +MKDIR_P='/bin/mkdir -p' +AWK='mawk' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +# +# INIT-COMMANDS +# +AMDEP_TRUE="" ac_aux_dir="." + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +double_quote_subst='s/\(["`\\]\)/\\\1/g' +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +macro_version='2.4.2' +macro_revision='1.3337' +enable_shared='yes' +enable_static='yes' +pic_mode='default' +enable_fast_install='yes' +SHELL='/bin/bash' +ECHO='printf %s\n' +PATH_SEPARATOR=':' +host_alias='' +host='x86_64-unknown-linux-gnu' +host_os='linux-gnu' +build_alias='' +build='x86_64-unknown-linux-gnu' +build_os='linux-gnu' +SED='/bin/sed' +Xsed='/bin/sed -e 1s/^X//' +GREP='/bin/grep' +EGREP='/bin/grep -E' +FGREP='/bin/grep -F' +LD='/usr/bin/ld -m elf_x86_64' +NM='/usr/bin/nm -B' +LN_S='ln -s' +max_cmd_len='1572864' +ac_objext='o' +exeext='' +lt_unset='unset' +lt_SP2NL='tr \040 \012' +lt_NL2SP='tr \015\012 \040\040' +lt_cv_to_host_file_cmd='func_convert_file_noop' +lt_cv_to_tool_file_cmd='func_convert_file_noop' +reload_flag=' -r' +reload_cmds='$LD$reload_flag -o $output$reload_objs' +OBJDUMP='objdump' +deplibs_check_method='pass_all' +file_magic_cmd='$MAGIC_CMD' +file_magic_glob='' +want_nocaseglob='no' +DLLTOOL='false' +sharedlib_from_linklib_cmd='printf %s\n' +AR='ar' +AR_FLAGS='cru' +archiver_list_spec='@' +STRIP='strip' +RANLIB='ranlib' +old_postinstall_cmds='chmod 644 $oldlib~$RANLIB $tool_oldlib' +old_postuninstall_cmds='' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $tool_oldlib' +lock_old_archive_extraction='no' +CC='gcc' +CFLAGS='-g -O2' +compiler='g++' +GCC='yes' +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +nm_file_list_spec='@' +lt_sysroot='' +objdir='.libs' +MAGIC_CMD='file' +lt_prog_compiler_no_builtin_flag=' -fno-builtin' +lt_prog_compiler_pic=' -fPIC -DPIC' +lt_prog_compiler_wl='-Wl,' +lt_prog_compiler_static='-static' +lt_cv_prog_compiler_c_o='yes' +need_locks='no' +MANIFEST_TOOL=':' +DSYMUTIL='' +NMEDIT='' +LIPO='' +OTOOL='' +OTOOL64='' +libext='a' +shrext_cmds='.so' +extract_expsyms_cmds='' +archive_cmds_need_lc='no' +enable_shared_with_static_runtimes='no' +export_dynamic_flag_spec='${wl}--export-dynamic' +whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +compiler_needs_object='no' +old_archive_from_new_cmds='' +old_archive_from_expsyms_cmds='' +archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +module_cmds='' +module_expsym_cmds='' +with_gnu_ld='yes' +allow_undefined_flag='' +no_undefined_flag='' +hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' +hardcode_libdir_separator='' +hardcode_direct='no' +hardcode_direct_absolute='no' +hardcode_minus_L='no' +hardcode_shlibpath_var='unsupported' +hardcode_automatic='no' +inherit_rpath='no' +link_all_deplibs='no' +always_export_symbols='no' +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' +include_expsyms='' +prelink_cmds='' +postlink_cmds='' +file_list_spec='' +variables_saved_for_relink='PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH' +need_lib_prefix='no' +need_version='no' +version_type='linux' +runpath_var='LD_RUN_PATH' +shlibpath_var='LD_LIBRARY_PATH' +shlibpath_overrides_runpath='no' +libname_spec='lib$name' +library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +soname_spec='${libname}${release}${shared_ext}$major' +install_override_mode='' +postinstall_cmds='' +postuninstall_cmds='' +finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +finish_eval='' +hardcode_into_libs='yes' +sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/4.7 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib ' +sys_lib_dlsearch_path_spec='/lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 ' +hardcode_action='immediate' +enable_dlopen='yes' +enable_dlopen_self='yes' +enable_dlopen_self_static='no' +old_striplib='strip --strip-debug' +striplib='strip --strip-unneeded' +compiler_lib_search_dirs='' +predep_objects='' +postdep_objects='' +predeps='' +postdeps='' +compiler_lib_search_path='' +LD_CXX='/usr/bin/ld -m elf_x86_64' +reload_flag_CXX=' -r' +reload_cmds_CXX='$LD$reload_flag -o $output$reload_objs' +old_archive_cmds_CXX='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $tool_oldlib' +compiler_CXX='g++' +GCC_CXX='yes' +lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +lt_prog_compiler_pic_CXX=' -fPIC -DPIC' +lt_prog_compiler_wl_CXX='-Wl,' +lt_prog_compiler_static_CXX='-static' +lt_cv_prog_compiler_c_o_CXX='yes' +archive_cmds_need_lc_CXX='no' +enable_shared_with_static_runtimes_CXX='no' +export_dynamic_flag_spec_CXX='${wl}--export-dynamic' +whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +compiler_needs_object_CXX='no' +old_archive_from_new_cmds_CXX='' +old_archive_from_expsyms_cmds_CXX='' +archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +module_cmds_CXX='' +module_expsym_cmds_CXX='' +with_gnu_ld_CXX='yes' +allow_undefined_flag_CXX='' +no_undefined_flag_CXX='' +hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' +hardcode_libdir_separator_CXX='' +hardcode_direct_CXX='no' +hardcode_direct_absolute_CXX='no' +hardcode_minus_L_CXX='no' +hardcode_shlibpath_var_CXX='unsupported' +hardcode_automatic_CXX='no' +inherit_rpath_CXX='no' +link_all_deplibs_CXX='no' +always_export_symbols_CXX='no' +export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' +include_expsyms_CXX='' +prelink_cmds_CXX='' +postlink_cmds_CXX='' +file_list_spec_CXX='' +hardcode_action_CXX='immediate' +compiler_lib_search_dirs_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.7 /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/4.7/../../..' +predep_objects_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbeginS.o' +postdep_objects_CXX='/usr/lib/gcc/x86_64-linux-gnu/4.7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o' +predeps_CXX='' +postdeps_CXX='-lstdc++ -lm -lgcc_s -lc -lgcc_s' +compiler_lib_search_path_CXX='-L/usr/lib/gcc/x86_64-linux-gnu/4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../..' + +LTCC='gcc' +LTCFLAGS='-g -O2' +compiler='gcc' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL ECHO PATH_SEPARATOR SED GREP EGREP FGREP LD NM LN_S lt_SP2NL lt_NL2SP reload_flag OBJDUMP deplibs_check_method file_magic_cmd file_magic_glob want_nocaseglob DLLTOOL sharedlib_from_linklib_cmd AR AR_FLAGS archiver_list_spec STRIP RANLIB CC CFLAGS compiler lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl lt_cv_sys_global_symbol_to_c_name_address lt_cv_sys_global_symbol_to_c_name_address_lib_prefix nm_file_list_spec lt_prog_compiler_no_builtin_flag lt_prog_compiler_pic lt_prog_compiler_wl lt_prog_compiler_static lt_cv_prog_compiler_c_o need_locks MANIFEST_TOOL DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 shrext_cmds export_dynamic_flag_spec whole_archive_flag_spec compiler_needs_object with_gnu_ld allow_undefined_flag no_undefined_flag hardcode_libdir_flag_spec hardcode_libdir_separator exclude_expsyms include_expsyms file_list_spec variables_saved_for_relink libname_spec library_names_spec soname_spec install_override_mode finish_eval old_striplib striplib compiler_lib_search_dirs predep_objects postdep_objects predeps postdeps compiler_lib_search_path LD_CXX reload_flag_CXX compiler_CXX lt_prog_compiler_no_builtin_flag_CXX lt_prog_compiler_pic_CXX lt_prog_compiler_wl_CXX lt_prog_compiler_static_CXX lt_cv_prog_compiler_c_o_CXX export_dynamic_flag_spec_CXX whole_archive_flag_spec_CXX compiler_needs_object_CXX with_gnu_ld_CXX allow_undefined_flag_CXX no_undefined_flag_CXX hardcode_libdir_flag_spec_CXX hardcode_libdir_separator_CXX exclude_expsyms_CXX include_expsyms_CXX file_list_spec_CXX compiler_lib_search_dirs_CXX predep_objects_CXX postdep_objects_CXX predeps_CXX postdeps_CXX compiler_lib_search_path_CXX; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED \"\$sed_quote_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\$$var\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_archive_cmds extract_expsyms_cmds old_archive_from_new_cmds old_archive_from_expsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds export_symbols_cmds prelink_cmds postlink_cmds postinstall_cmds postuninstall_cmds finish_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec reload_cmds_CXX old_archive_cmds_CXX old_archive_from_new_cmds_CXX old_archive_from_expsyms_cmds_CXX archive_cmds_CXX archive_expsym_cmds_CXX module_cmds_CXX module_expsym_cmds_CXX export_symbols_cmds_CXX prelink_cmds_CXX postlink_cmds_CXX; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\$$var\\\"" + ;; + esac +done + +ac_aux_dir='.' +xsi_shell='yes' +lt_shell_append='yes' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='gyoto' + VERSION='0.0.4' + TIMESTAMP='' + RM='rm -f' + ofile='libtool' + + + + + + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "yorick/Makefile") CONFIG_FILES="$CONFIG_FILES yorick/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["am__EXEEXT_FALSE"]="" +S["am__EXEEXT_TRUE"]="#" +S["LTLIBOBJS"]="" +S["sovers"]="0.0.0" +S["plugin_sfx"]="so" +S["CFITSIOCPPFLAGS"]="" +S["CFITSIOLDFLAGS"]=" -lcfitsio" +S["use_cfitsio"]="-DGYOTO_USE_CFITSIO" +S["XERCESCPPFLAGS"]="" +S["XERCESLDFLAGS"]=" -lxerces-c" +S["use_xerces"]="-DGYOTO_USE_XERCES" +S["POW_LIB"]="" +S["LIBOBJS"]="" +S["YORICK"]="yorick" +S["CXXCPP"]="g++ -E" +S["am__fastdepCXX_FALSE"]="#" +S["am__fastdepCXX_TRUE"]="" +S["CXXDEPMODE"]="depmode=gcc3" +S["ac_ct_CXX"]="g++" +S["CXXFLAGS"]="-g -O2" +S["CXX"]="g++" +S["CPP"]="gcc -E" +S["OTOOL64"]="" +S["OTOOL"]="" +S["LIPO"]="" +S["NMEDIT"]="" +S["DSYMUTIL"]="" +S["MANIFEST_TOOL"]=":" +S["RANLIB"]="ranlib" +S["ac_ct_AR"]="ar" +S["AR"]="ar" +S["DLLTOOL"]="false" +S["OBJDUMP"]="objdump" +S["LN_S"]="ln -s" +S["NM"]="/usr/bin/nm -B" +S["ac_ct_DUMPBIN"]="" +S["DUMPBIN"]="" +S["LD"]="/usr/bin/ld -m elf_x86_64" +S["FGREP"]="/bin/grep -F" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["SED"]="/bin/sed" +S["am__fastdepCC_FALSE"]="#" +S["am__fastdepCC_TRUE"]="" +S["CCDEPMODE"]="depmode=gcc3" +S["am__nodep"]="_no" +S["AMDEPBACKSLASH"]="\\" +S["AMDEP_FALSE"]="#" +S["AMDEP_TRUE"]="" +S["am__quote"]="" +S["am__include"]="include" +S["DEPDIR"]=".deps" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]="" +S["LDFLAGS"]="" +S["CFLAGS"]="-g -O2" +S["CC"]="gcc" +S["host_os"]="linux-gnu" +S["host_vendor"]="unknown" +S["host_cpu"]="x86_64" +S["host"]="x86_64-unknown-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="unknown" +S["build_cpu"]="x86_64" +S["build"]="x86_64-unknown-linux-gnu" +S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" +S["am__untar"]="$${TAR-tar} xf -" +S["am__tar"]="$${TAR-tar} chof - \"$$tardir\"" +S["AMTAR"]="$${TAR-tar}" +S["am__leading_dot"]="." +S["SET_MAKE"]="" +S["AWK"]="mawk" +S["mkdir_p"]="/bin/mkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" +S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" +S["STRIP"]="strip" +S["install_sh"]="${SHELL} /home/thibaut/git/Gyoto/install-sh" +S["MAKEINFO"]="${SHELL} /home/thibaut/git/Gyoto/missing --run makeinfo" +S["AUTOHEADER"]="${SHELL} /home/thibaut/git/Gyoto/missing --run autoheader" +S["AUTOMAKE"]="${SHELL} /home/thibaut/git/Gyoto/missing --run automake-1.11" +S["AUTOCONF"]="${SHELL} /home/thibaut/git/Gyoto/missing --run autoconf" +S["ACLOCAL"]="${SHELL} /home/thibaut/git/Gyoto/missing --run aclocal-1.11" +S["VERSION"]="0.0.4" +S["PACKAGE"]="gyoto" +S["CYGPATH_W"]="echo" +S["am__isrc"]="" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="-ldl " +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="gyoto@sympa.obspm.fr" +S["PACKAGE_STRING"]="gyoto 0.0.4" +S["PACKAGE_VERSION"]="0.0.4" +S["PACKAGE_TARNAME"]="gyoto" +S["PACKAGE_NAME"]="gyoto" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/bash" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { + line = $ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="CXX " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 diff -Nru gyoto-0.0.3/yorick/configure gyoto-0.1.0/yorick/configure --- gyoto-0.0.3/yorick/configure 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/bin/sh -set -e -yorick -batch make.i -cd stdplug; yorick -batch make.i -exit 0 diff -Nru gyoto-0.0.3/yorick/configure.old gyoto-0.1.0/yorick/configure.old --- gyoto-0.0.3/yorick/configure.old 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/configure.old 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +yorick -batch make.i +cd stdplug; yorick -batch make.i +exit 0 diff -Nru gyoto-0.0.3/yorick/gyoto.i gyoto-0.1.0/yorick/gyoto.i --- gyoto-0.0.3/yorick/gyoto.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto.i 2013-07-27 09:14:20.000000000 +0000 @@ -1,6 +1,6 @@ plug_in, "gyoto"; /* - Copyright 2011 Thibaut Paumard + Copyright 2011-2013 Thibaut Paumard This file is part of Gyoto. @@ -20,12 +20,42 @@ #include "graphk.i" +extern gyoto_haveXerces; +/* DOCUMENT have_xerces = gyoto_haveXerces() + Tell whether GYOTO was compiled with Xerces support (XML i/o) + OUTPUT: + HAVE_XERCES=1 if compiled with Xerces, else 0. +*/ + extern __gyoto_setErrorHandler; /* xDOCUMENT __gyoto_setErrorHandler Must be called once to attach the GYOTO error handler to Yorick's one */ __gyoto_setErrorHandler; +extern gyoto_loadPlugin; +/* DOCUMENT gyoto_loadPlugin, plugin[, plugin2[, plugin3]] [, nofail=1] + + Load Gyoto plug-ins. + + INPUTS: + gyoto_loadPlugins() accepts an aribtrary number of positional + arguments, each a string or string array naming individual Gyoto + plugins. For instance, all of the following attempt to load the + plug-ins, stdplug, lorene and myplug: + gyoto_loadPlugin, "stdplug", "lorene", myplug" + gyoto_loadPlugin, ["stdplug", "lorene", myplug"] + gyoto_loadPlugin, "stdplug", ["lorene", myplug"] + + KEYWORDS: + nofail= if set and true, failure to load a plug-in will not trigger + an error. It applies to _all_ plug-ins in the list. + + EXAMPLE: + gyoto_loadPlugin, "stdplug" + gyoto_loadPlugin, "lorene", nofail=1 + */ + extern __gyoto_initRegister; /* xDOCUMENT __gyoto_initRegister Must be called once to initialize the GYOTO plug-in register @@ -39,13 +69,8 @@ require, "pl3d.i"; -#include "gyoto_Photon.i" -#include "gyoto_Scenery.i" #include "gyoto_constants.i" -include, "gyoto_std.i", 2; - - local gyoto; /* DOCUMENT GYOTO -- General relativtY Orbit Tracer of Observatoire de paris @@ -104,21 +129,26 @@ later point in time: gg = gyoto_KerrBL( spin=0.995, mass=4e6 ) ; gg, spin=0.5; - spin_param = gg(spin=); + spin_param = gg(spin=); // or spin_param = gg.spin Note how giving a member keyword without any value, as in the last - example above, allows _retrieving_ the previously set value. When - setting member, it is also possible to call the object as a + example above, allows _retrieving_ the previously set value. The + alternative dot notation is semantically equivalent but slightly + slower. + + When setting member, it is also possible to call the object as a function. In that case, the return value will be the object itself, allowing to call it again as a function: - spin_val = gg(spin=0.5)(spin=); + spin_val = gg(spin=0.5)(spin=) + or spin_val = gg(spin=0.5).spin Although the above example is trivial, this is useful in some complex situations: - Setting the resolution in a Screen attached to a Scenery: + Getting the resolution in a Screen attached to a Scenery: res_val = scenery(screen=)(resolution=); + res_val = scenery.screen.resolution; // more elegant but slower Setting resolution: - noop, scenery(screen=)(resolution=res_val); - (The noop above is not mandatory.) + noop, scenery.screen(resolution=res_val); + (The noop above is not mandatory but avoid spurious display). Some member keywords accept more than one parameter, separated by comas. This is the first exception GYOTO makes to the Yorick @@ -156,12 +186,12 @@ // object gg_clone = gg(clone=); // This is cloning: gg3 is a detached - // copy + gg_clone = gg.clone // copy gg_copy, spin=0.2; gg_clone, spin=0.7; - gg(spin=); // the spin in gg is the same as in gg_copy, not + gg.spin; // the spin in gg is the same as in gg_copy, not // gg_clone. @@ -258,7 +288,7 @@ Trace the trajectory of a photon in the secondary image of the above: ph = gyoto_Photon(initcoord=sc,77,45, xfill=870.623); - txyz = ph(get_txyz=1); + txyz = ph.get_txyz; plg, txyz(,3), txyz(,2); limits, square=1; @@ -271,10 +301,350 @@ */ +//////// SCENERY + +extern gyoto_Scenery; +/* DOCUMENT scenery = gyoto_Scenery([filename,] [members=values ...]) + Create GYOTO Scenery object + or scenery, [members=values] + Set GYOTO Scenery member + or res = scenery(member=) or res = scenery.member + Get GYOTO Scenery member + or scenery, xmlwrite=filename + Save Scenery description to XML + or data = scenery([ irange, jrange [, quantities ]]) + Ray-trace scenery + + PURPOSE: + Create and use GYOTO Scenery objects. + + A GYOTO Scenery is used to render an image by relativistic + ray-tracing. A GYOTO Scenery contains references to: + - a GYOTO Metric ("the stage"); + - a GYOTO Astrobj ("the actors"); + - a GYOTO Screen ("the camera"). + + See GYOTO for basic concepts and syntax. + + + MEMBERS: + + metric= see gyoto_Metric(): what "straight" means for light + travel; + + screen= see gyoto_Screen(), it specifies where the obseerver is + located and the obseerving time; + + astrobj= see gyoto_Astrobj(): where the light comes from; + + delta= a double scalar, the initial integration step for the + Photons laucnched during ray-tracing; + + adaptive= whether integration uses adaptive step + + maxiter= maximum number of iterations in integration (per Photon) + + quantities= an array of strings giving the names of physical + quantities that should be retrieved during + ray-tracing. Beware that not all Astrobj kinds support + all of those quantities. The order in which the + quantities are listed when setting this member is not + relevant, the following are equivalent: + data = scenery(quantities=["EmissionTime", "Intensity"])(); + and + data = scenery(quantities=["Intensity", "EmissionTime"])(); + Setting quantities here is not mandatory as the third + positional argument used for ray-tracing permits to + override it in an ordered fashion. + + Recognized quantities: + "Intensity": apparent intensity of the Astrobj; + "EmissionTime": time at which each photonreaching the + screen was emitted; + "MinDistance": minimum distance ever reached between + each photon (whether comingfrom the object or not) + and the Astrobj); + "FirstDistMin": First local minimum in the + Astrobj/Photon distance; + "Redshift": ; + "ImpactR", "ImpactX", "ImpactY" and "ImpactZ": R + (specrical), X, Y and Z (Cartsesian) coordinates + at which a photon was emitted by the Astrobj; + "Spectrum": Inu spectrum of the Astrobj on this pixel, + the spectrometer is specified in the Screen + object; + "BinSpectrum": spectrum of the Astrobj on this pixel + (the spectrometer is specified in the Screen + object), as would be detected by a real + spectrometer: the value in each spectral channel + is the integral of Inu over the spectral channel; + "User1" to "User5": other specific scalar quantities an + Astrobj may be able to compute, refer to the + documentation for the Astrobj kind of your choice. + + nthreads=number of parallel threads to use in + gyoto_Scenery_rayTrace. This has no effect when + ray-tracing using the "data = scenery()" syntax below. + + RAY-TRACING: + + Ray-traced data is retrieved calling the object like a function + with no keyword: + data = scenery (); + or data = scenery (irange, jrange, quant ) + + IRANGE and JRANGE are either scalars (i, j) or ranges in the usual + form min:max:step. QUANT is an array of Yorick strings where each + element selects one quantity to retrieve (see the QUANTITIES + member above). QUANT may be void to use the quantities already set + in the Scenery or the default for the Astrobj. If specifyng QUANT, + DATA will be a MxNxP double array, where P=numberof(QUANT) and + DATA(,,i) will contain the value of the quantity specifeid by + QUANT(i). + + QUANTITIES may also be a scalar to retrieve a single + quantity. + + The "Spectrum" quantity is a bit peculiar since it take more than + one plane in data. + + SEE ALSO: + gyoto_Metric, gyoto_Screen, gyoto_Astrobj, gyoto_Photon, + gyoto_Spectrometer, gyoto_Scenery_rayTrace +*/ + +extern gyoto_Scenery_rayTrace +/* DOCUMENT res = gyoto_Scenery_rayTrace(scenery, imin, imax, jmin, jmax, + impactcoords) + + if IMPACTCOORDS is an unadorned, nil variable it is output. If it + is an expression or non-nil, it is input. + */ + +func _gyoto_Scenery_adaptive_raytrace(sco, respmax, &computed) { +/* xDOCUMENT data = gyoto_Scenery_adaptive_raytrace(scenery, pmax, [computed]) + +BROKEN + + Ray-trace a GYOTO Scenery on an adaptive grid. + + For certain kinds of objects (in particular, Stars), this routine + is much faster than the equivalent: + data = scenery(resolution=3^pmax, raytrace=1); + It is NOT guaranteed that the two methods yield the same result. + + The minimum distance between photon and object is first computed + on a coarse grid which is then refined as required. + + SEE ALSO: gyoto_Scenery + */ + write, format="%s\n", + "WARNING: gyoto_Scenery_adaptive_raytrace() is under development"; + + sc = sco(clone=); // don't modify calling object + + DBL_MAX=1e100; + + screen = sc(screen=); + + respmax=long(respmax); + + resp=1; + resmax=3^respmax; + step=long(3^(respmax-resp)); + first=step/2+1; + + data=array(double, resmax, resmax, 6); + + quantities = ["Intensity", "EmissionTime", "MinDistance", "ImpactX", "ImpactY", "ImpactZ"]; + + screen, resolution=resmax; + data(first::step, first::step, ) = + sc(first::step, first::step, quantities); + + computed=array(long,resmax,resmax); + + nb=9; + for (resp=2, res=3; resp<=respmax; ++resp) { + + // largest distance to neighbour + dsub=data(first::step, first::step,); + ind=where(dsub>=DBL_MAX); + if (numberof(ind)) dsub(ind)=DBL_MAX; + delta = array(double, res, res); + d1=(dsub(dif,,4:6)^2)(,,sum); + d2=(dsub(,dif,4:6)^2)(,,sum); + delta(2:-1,2:-1)=[d1(:-1,2:-1), d1(2:,2:-1), d2(2:-1,:-1), d2(2:-1,2:)](,,max); + delta(1,2:-1)=[d1(1,2:-1), d2(1,:-1), d2(1,2:)](,max); + delta(0,2:-1)=[d1(0,2:-1), d2(0,:-1), d2(0,2:)](,max); + delta(2:-1,1)=[d2(2:-1,1), d1(:-1,1), d1(2:,1)](,max); + delta(2:-1,0)=[d2(2:-1,0), d1(:-1,0), d1(2:,0)](,max); + delta(0,0)=[d1(0,0), d2(0,0)](max); + delta(1,1)=[d1(1,1), d2(1,1)](max); + delta(0,1)=[d1(0,1), d2(0,1)](max); + delta(1,0)=[d1(1,0), d2(1,0)](max); + + + // ! BEWARE : res is updated here + res*=3; + refine=array(int, res, res); + refine(1::3, 1::3) = + refine(2::3, 1::3) = + refine(3::3, 1::3) = + refine(1::3, 2::3) = + refine(2::3, 2::3) = + refine(3::3, 2::3) = + refine(1::3, 3::3) = + refine(2::3, 3::3) = + refine(3::3, 3::3) = + (dsub(,,3)<4*delta) | (dsub(,,3)<2); + + nstep=long(3^(respmax-resp)); + nfirst=first-nstep; + data(nfirst ::step,nfirst ::step,)= + data(first ::step,nfirst ::step,)= + data(first+nstep::step,nfirst ::step,)= + data(nfirst ::step,first ::step,)= + data(first+nstep::step,first ::step,)= + data(nfirst ::step,first+nstep::step,)= + data(first ::step,first+nstep::step,)= + data(first+nstep::step,first+nstep::step,)= + dsub; + + step=nstep; + first=nfirst; + for (i=1; i<=res; ++i) { + ibis=(i-1)*step+first; + ind=where(refine(i,) & !computed(ibis,first::step)); + nb+=numberof(ind); + if (numberof(ind)) { + indbis=(ind-1)*step+first; + data(ibis,indbis,)=sc(ibis, indbis, quantities); + computed(ibis, indbis)=resp; + } + } + + } + nb; + return data; +} + +// PHOTON CLASS +extern gyoto_Photon; +/* DOCUMENT photon = gyoto_Photon([filename], [members=values]) + photon, member=values + value = photon(member=) or value = photon.member + value = photon(function_method=params) + photon, subroutine_method=params + + PURPOSE: + + Instanciate and use a single GYOTO photon. + + Photons are mass-less particles following light-like geodesics of + a metric. For basic concepts, see GYOTO. For ray-tracing, + gyoto_Scenery() is more appropriate. + + MEMBERS: + + Members can be set with the syntax "photon, member=value" and + retrieved with the syntax "value=photon(member=)" or + "value=photon.member": + + metric= a GYOTO Metric (see gyoto_Metric), + initcoord=scenery,x,y also sets the metric. + astrobj=a GYOTO Astrobj (see gyoto_Astroj), the target of + ray-tracing. + + initcoord= the initial coordinates (4-position & 4 velocity). + There are many ways to specify this: + + initcoord=COORD8 + directly give the 8 coordinates; + initcoord=POS4,VEL4 + as above, with a coma in-between; + initcoord=POS4,VEL3 this time only 3 coordinates are given + for the velocity vector. The light-ray will be tangent + to this 3-vector. + initcoord=SCREEN,DALPHA,DDELTA + SCREEN is a gyoto_Screen, DALPHA and DDELTA specify + the direction this photon comes from when it reaches + the screen. DALPHA and DDELTA are in radians and must + be floating-point values. + initcoord=SCREEN,I,J + As above, but I and J are integers specifying the + pixel of the arrival SCREEN which the photon hits. + initcoord=SCENERY,DALPHA,DDELTA + initcoord=SCENERY,I,J + As above, but specify a gyoto_Scenery instead of a + gyoto_Screen. The Metric and Astrobj of the Senery + will also be attached to the Photon. + + Those last ways of specifying the initial conditions are + very useful to get the trajectory of a specific photon in + a ray-traced scenery. + + spectro= a gyoto_Spectrometer + + delta= integration step (initial in case of adaptive, the + default) + + adaptive= whether integration uses adaptive step + + maxiter= maximum number of iterations in integration + + SUBROUTINE-LIKE METHODS: + + Several of these keywords can by specified whenever creating or + accessing the object. + + xfill=TLIM Integrate the geodesic from the time specified with + INITCOORD to tlim (the integrated geodesic remains stored + in the PHOTON); + + save_txyz=FILENAME Dump the integrated geodesic in cartesian + coordinates in ASCII file FILENAME. + + xmlwrite=filename as usual, save an XML description of this + photon; + + setparameter=name[,value] set any low-level parameter. Name and + value are strings. + + FUNCTION-LIKE METHODS: + + The object PHOTON will return a value when called as a function + with the following keywords set: + + is_hit= Return 1 if this photon hits the Astrobj + + get_txyz= Return the geodesic in Cartesian coordinates: + data = photon(xfill=tlim, get_txyz=) + data will be a Nx4 double array where data(i,) contains + the 4-position in Cartesian coordinates of the photon for + all the dates computed by the integrator between + INITCOORD[0] and TLIM. + + get_coord= Return the geodesic in Metric coordinatess: same as + above, but in the prefered coordinate system for this + metric, which may be Cartesian or spherical. + + get_coord=dates Same as above, but for the dates specified in + double array DATES. + + get_cartesian=dates Get the 3-position and 3-velocity of the + Photon in Cartesian coordinates for the specified dates. + + SEE ALSO: gyoto, gyoto_Metric, gyoto_Screen, gyoto_Scenery, + gyoto_Astrobj + */ + +/// METRIC + extern gyoto_Metric; /* DOCUMENT gg = gyoto_Metric( filename, [members=values] ) gg, members=values - retval = gg(member=); + retval = gg(member=) or retval = gg.member; retval = gg(function_method=par1, par2...) gg, xmlwrite=filename coef = gg(coordinates, mu, nu) @@ -335,11 +705,14 @@ Additional function-like or subroutine like methods: coord=gg(prime2tdot=pos, vel): COORD is the 8-vector where - COORD[1-4]==POS and COORD[5-8] is the 4-velocity - corresponding to the 3-velocity VEL; + COORD[1-4]==POS and COORD[5-8] is the 4-velocity + corresponding to the 3-velocity VEL; - gg, nullifycoord=pos, vel return nullified (photon) coord tangent - to vel at pos. + vel4 =gg(nullifycoord=pos, vel) + Return nullified (photon) coord tangent to vel at pos. + + prod = gg(scalarprod=pos, u1, u2) + Return (4-dimensional) scalar product. vels = gg(circularvelocity=coords [, dir]) On input, COORDS is an array of doubles yielding @@ -364,7 +737,7 @@ extern gyoto_Astrobj; /* DOCUMENT ao = gyoto_Astrobj( filename ); ao, member1=val1, member2=val2...; - val = ao(member=) + val = ao(member=) or val = ao.member ao, xmlwrite=filename Generic class for describing an astronomical object (a star, an @@ -386,7 +759,7 @@ All the kinds of Astrobjs share a few members that can be accessed with the following keywords. To set the member, use "ao, member=value". To retrieve the current value of the member, use - "retval = ao(member=)". + "retval = ao(member=)" or "retval = ao.member". rmax: for optimization, tell the Scenery that this object does not extend over RMAX from the center of the @@ -420,22 +793,29 @@ for the specific class. See Gyoto::Astrobj::Generic::setParameter(). - SEE ALSO: gyoto + EXAMPLES: The following implement specific objects, most require gyoto_std.i: gyoto_Star A spherical object moving along a geodesic gyoto_FixedStar A spherical object of constant coordinates gyoto_Torus A simple torus (solid, Keplerian rotation) gyoto_ThinDisk A geometrically thin disk - gyoto_PageThorneDisk As above with Page & Thorne 1974 emission gyoto_PatternDisk As above, emission numerically provided gyoto_Disk3D Thick disk, emission numerically provided + + It is also possible to instanciate an astrobj by kind name even if + this kind is not explicitly implemented in the yorick plug-in: + gyoto_Astrobj("PageThorneDisk") + A geometrically thin, optically thick disk + with Page & Thorne 1974 emission + + SEE ALSO: gyoto */ extern gyoto_ThinDisk; /* DOCUMENT ao = gyoto_ThinDisk( filename ); ao, member1=val1, member2=val2...; - val = ao(member=) + val = ao(member=) or val = ao.member ao, xmlwrite=filename A more specific version of the gyoto_Astrobj function. A very @@ -453,9 +833,9 @@ -1 if coounter rotating. SEE ALSO: gyoto, gyoto_Astrobj - There are two derived classes in gyoto_std.i: - gyoto_PageThorneDisk As above with Page & Thorne 1974 emission + There is one derived classe in gyoto_std.i: gyoto_PatternDisk As above, emission numerically provided + try also gyoto_Astrobj("PageThorneDisk") */ @@ -504,7 +884,7 @@ Member keywords are used to set the value of a member (screen, member=value) or to retrieve the value of a memeber - (value=screen(member=)): + (value=screen(member=) or value=screen.member): metric, time, tmin, fov (field-of-view), resolution (N pixels on each side), distance (meters), inclination, paln (position angle of the line of nodes), argument, pojection (=[incl, paln, @@ -572,23 +952,24 @@ SEE ALSO: gyoto, gyoto_Star */ -extern is_gyoto_Spectrum; - -/* DOCUMENT bool = is_gyoto_Spectrum(arg) - BOOL is 1 if arg is a gyoto_Spectrum - SEE ALSO: gyoto, gyoto_Spectrum - */ - extern gyoto_debug; /* DOCUMENT gyoto_debug, 1/0 Turn GYOTO debug output on/off. SEE ALSO: gyoto */ +extern gyoto_verbose; +/* DOCUMENT gyoto_verbose, level + or level = gyoto_verbose() + Set/get Gyoto verbosity level + SEE ALSO: gyoto + */ + extern gyoto_Spectrometer; -/* DOCUMENT spectro = gyoto_Spectrometer([members=values]) - or spectro, members=values - or table = spectro( channels= | midpoints= | widths= ) +/* DOCUMENT spectro = gyoto_Spectrometer([filename],[members=values]) + or spectro, xmlwrite=filename + or var = spectro( channels= | midpoints= | widths= | + nsamples= | kind= | clone= ) The spectrometric capabilities of a GYOTO Screen or Photon. @@ -598,42 +979,128 @@ For basics, see GYOTO. + In the first form, if FILENAME is specified, a new Spectrometer + is instanciated from XML file FILENAME. FILENAME can also name a + Spectrometer Kind, such as "Complex" or "wave". + + KEYWORDS: + unit= a string, affects methods called together: + channels_in_microns=spectro(channels=, unit="microm") + + METHODS: + xmlwrite=filename, write XML desription of this spectrometer + to hard drive. E.g. spectro, wmlwrite="file.xml" + + The following keywords allow retrieving information on the + spectrometer. They don't take a value but return one with this + syntax: retval=spectro(keyword=) + + kind= returns the Spectrometer kind name, e.g. "wave", + "freq" or "Complex". + nsamples= returns the number of spectral channels. + channels= return an array(double, NSAMPLES, 2) yielding the + edges of each spectral channel in UNIT (default: Hz) + midpoints= returns an array(double, NSAMPLES) yielding the central + frequency of each spectral channel in UNIT (default: Hz). + widths= returns the width of each spectral channel in UNIT + (default: Hz). + clone= returns a deep copy of this Spectrometer. + + SEE ALSO: gyoto, gyoto_Screen, gyoto_Scenery, + gyoto_SpectroUniform, gyoto_SpetroComplex + */ + +extern gyoto_SpectroUniform; +extern _gyoto_SpectroUniform_register_as_Spectro; +/* DOCUMENT spectro = gyoto_SpectroUniform([members=values]) + or spectro, keywords=values + or retval = spectro( keyword= ) + + gyoto_SpectroUniform() is a more specific implementation of + gyoto_Spectrometer(). It allows creating an Spectrometer::Uniform + object which models a spectrometer where NSAMPLES spectral + channels are unifromly spaced in wavelength, frequency, or log10 + thereof. + + gyoto_SpectroUniform has a superset of the functionalities of + gyoto_Spectrometer. + MEMBERS: Members can be set with "spectro, member=value" and retrieved - with "value = spectro(member=)". + with "value = spectro(member=)" or "value=spectro.member". kind= a string, one of "none", "wave", "freq", "wavelog", "freqlog". KIND affects how BAND below is interpreted - and how CHANNELS and MIDPOINTS are returned. + and how CHANNELS and MIDPOINTS are returned. Since + these four "kinds" are actually based on the same + code, it is possible to convert a Spetrcometer + between them. nsamples= a long, the number of spectral channels in this spectrometer; band= a pair of doubles, the lower and upper boundaries of the spectral band covered by this spectrometer. - The unit in which BAND is expressed depends on KIND: + The default unit in which BAND is expressed depends + on KIND: KIND UNIT freq Hz - freqlog Log(Hz) + freqlog log10(Hz) wave m - wavelog Log(m) + wavelog log10(m) + Keyword UNIT can be set to use a different unit than + the default. For kinds freqlog and wavelog, + log10(unit) is used. METHODS: - The following keywords allow retrieving the spectral band for - each of the spectral channel in one of two forms: - channels= an array(double, NSAMPLES+1) yielding the edges - of each spectral channel, in the same unit as - BAND depending on KIND. - midpoints= an array(double, NSAMPLES) yielding the central - _frequency_ of each spectral channel expressed in - the same unit as BAND depending on KIND. - widths= the width of each spectral channel in Hz. + The following methods from gyoto_Spectrometer are implemented: + xmlwrite, clone, channels, midpoints, widths. - clone= get a clone of this Spectrometer - - SEE ALSO: gyoto, gyoto_Screen, gyoto_Scenery + SEE ALSO: gyoto_Spectrometer, gyoto_SpectroComplex */ +_gyoto_SpectroUniform_register_as_Spectro; +extern gyoto_SpectroComplex; +extern _gyoto_SpCplx_register_as_Spectrometer; +/* DOCUMENT spectro = gyoto_SpectroComplex([members=values]) + or spectro, keywords=values + or retval = spectro( keyword= ) + or subspectro = spectro(index) + + gyoto_SpectroComplex() is a more specific implementation of + gyoto_Spectrometer(). It allows creating an Spectrometer::Complex + object which models a spectrometer made of several simpler + Spectrometer objects (sub-spectrometers). + + gyoto_SpectroComplex has a superset of the functionalities of + gyoto_Spectrometer. + + A single sub-spectrometer can be retrieved by its INDEX. INDEX is + 1-based, as is customary in Yorick. + + EXAMPLE: + sp1 = gyoto_SpectroUniform(kind="wave", + nsamples=10, + unit="microm", + band=[1, 2]); + sp2 = gyoto_SpectroUniform(kind="freqlog", + nsamples=10, + unit="eV", + band=[10, 20]); + sp = gyoto_SpectroComplex(append=sp1)(append=sp2); + sp1bis = sp(1); + sp2bis = sp(2); + + METHODS: + The following methods from gyoto_Spectrometer are implemented: + xmlwrite, clone, channels, midpoints, widths. In addition, + gyoto_SpectroComplex accepts the following methods: + append=subspectro add new sub-spectrometer + remove=index remove sub-spectrometer INDEX + + SEE ALSO: gyoto_Spectrometer, gyoto_SpectroUniform + */ +_gyoto_SpCplx_register_as_Spectrometer; func gyoto_plg3(x,y,z, keywords=) { /* DOCUMENT gyoto_plg3, x, y, z @@ -846,19 +1313,21 @@ else return x_unit; } -func gyoto_warning(msg) { - if (_gyoto_running) gyotoy_warning,msg; - else error, msg; -} - - +extern is_gyoto_Photon; extern is_gyoto_Astrobj; -/* DOCUMENT ret = is_gyoto_Astrobj( obj ) +extern is_gyoto_Metric; +extern is_gyoto_Spectrometer; +extern is_gyoto_Spectrum; +extern is_gyoto_Screen; +extern is_gyoto_Scenery; +/* DOCUMENT bool = is_gyoto_BASE(arg) + + BOOL is 1 if arg is a gyoto_BASE where base is Metric, Astrobj, + Spectrum, Spectrometer, Scenery, Screen... - Return 1 if OBJ is a GYOTO Astrobj + SEE ALSO: gyoto + */ - SEE ALSO: gyoto gyoto_Astrobj -*/ extern gyoto_dontcatchSIGFPE; @@ -866,5 +1335,15 @@ extern gyoto_listRegister; /* DOCUMENT gyoto_listRegister - list the register of known Astrobj, Metric and Spectrum kinds. + List the register of known Astrobj, Metric, Spectrum and + Spectrometer kinds. + SEE ALSO: gyoto */ + +if (is_func(use)) { + include, "gyoto_namespace.i", 1; + } else { + gyoto_namespace=noop; + } + +include, "gyoto_std.i", 2; diff -Nru gyoto-0.0.3/yorick/gyoto.info gyoto-0.1.0/yorick/gyoto.info --- gyoto-0.0.3/yorick/gyoto.info 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto.info 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -Package: gyoto -Kind: plugin -Version: 1.0~pre1 -Revision: 1 -Description: the General relativitY Orbit Tracer of Observatoire de Paris -License: GPL-3+ -Author: Thibaut Paumard -Maintainer: Thibaut Paumard -OS: architecture independant -Depends: yorick(>=2.1.05), yutils(>=1.3.0) -Source: http://gyoto.obspm.fr/downloads/gyoto-%v.tgz -Source-MD5: -Source-Directory: -DocFiles: README AUTHORS COPYING -Homepage: http://gyoto.obspm.fr/ -DescDetail: << -Gyoto aims at providing a framework for computing orbits and -ray-traced images in General relativity. It consists in a library -(libgyoto), utility programs, and a plug-in for Yorick. -<< -DescUsage: << -See check.i for a test suite. Type -"yorick -i check.i" in a terminal to run it. -<< -DescPort: << -<< diff -Nru gyoto-0.0.3/yorick/gyoto.info.in gyoto-0.1.0/yorick/gyoto.info.in --- gyoto-0.0.3/yorick/gyoto.info.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto.info.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,26 @@ +Package: gyoto +Kind: plugin +Version: @VERSION@ +Revision: 1 +Description: the General relativitY Orbit Tracer of Observatoire de Paris +License: GPL-3+ +Author: Thibaut Paumard +Maintainer: Thibaut Paumard +OS: architecture independant +Depends: yorick(>=2.2), yutils(>=1.3.0) +Source: https://github.com/gyoto/Gyoto/archive/%v.tar.gz +Source-MD5: +Source-Directory: +DocFiles: README AUTHORS COPYING +Homepage: http://gyoto.obspm.fr/ +DescDetail: << +Gyoto aims at providing a framework for computing orbits and +ray-traced images in General relativity. It consists in a library +(libgyoto), utility programs, and a plug-in for Yorick. +<< +DescUsage: << +See check.i for a test suite. Type +"yorick -i check.i" in a terminal to run it. +<< +DescPort: << +<< diff -Nru gyoto-0.0.3/yorick/gyoto_Astrobj.C gyoto-0.1.0/yorick/gyoto_Astrobj.C --- gyoto-0.0.3/yorick/gyoto_Astrobj.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Astrobj.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -22,9 +22,10 @@ #include "pstdlib.h" #ifdef GYOTO_USE_XERCES -#include +#include "GyotoFactory.h" #endif +#include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; @@ -35,70 +36,46 @@ ={0}; static int ygyoto_Astrobj_count=0; +YGYOTO_YUSEROBJ(Astrobj, Astrobj::Generic) +YGYOTO_BASE_CONSTRUCTOR(Astrobj) + extern "C" { - // ASTROBJ CLASS - // Opaque Yorick object - typedef struct gyoto_Astrobj { - SmartPointer astrobj; - //char type[YGYOTO_TYPE_LEN]; - } gyoto_Astrobj; - void gyoto_Astrobj_free(void *obj) { - if (((gyoto_Astrobj*)obj)->astrobj) { - ((gyoto_Astrobj*)obj)->astrobj = NULL; - } else printf("null pointer\n"); - } - void gyoto_Astrobj_print(void *obj) { -#ifdef GYOTO_USE_XERCES - string rest="", sub=""; - size_t pos=0, len=0; - try {rest = Factory(((gyoto_Astrobj*)obj)->astrobj).format();} - YGYOTO_STD_CATCH; - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); - } -#else - y_print("GYOTO Astrobj object of type ",0); - y_print(((gyoto_Astrobj*)obj)->astrobj->getKind().c_str(),0); -#endif - } void gyoto_Astrobj_eval(void *obj, int argc) { GYOTO_DEBUG << endl; // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { - ypush_long((long)((gyoto_Astrobj*)obj)->astrobj()); + ypush_long((long)((gyoto_Astrobj*)obj)->smptr()); return; } // Try calling kind-specific worker int n=0; - SmartPointer * ao = &(((gyoto_Astrobj*)obj)->astrobj); - const string kind = (*ao)->getKind(); + SmartPointer * OBJ = &(((gyoto_Astrobj*)obj)->smptr); + const string kind = (*OBJ)->getKind(); while (n((*ao)())) base = THINDISK; + if (dynamic_cast((*OBJ)())) base = THINDISK; - static char const * knames_thindisk[]={YGYOTO_THINDISK_GENERIC_KW, 0}; - static char const * knames_generic[]={YGYOTO_ASTROBJ_GENERIC_KW, 0}; - static long kglobs[YGYOTO_ASTROBJ_BASE_MAX_KW_N+1]; - static int kiargs[YGYOTO_ASTROBJ_BASE_MAX_KW_N]; + static char const * knames_thindisk[]={"unit", YGYOTO_THINDISK_GENERIC_KW, 0}; + static char const * knames_generic[]={"unit", YGYOTO_ASTROBJ_GENERIC_KW, 0}; + static long kglobs[YGYOTO_ASTROBJ_BASE_MAX_KW_N+2]; + static int kiargs[YGYOTO_ASTROBJ_BASE_MAX_KW_N+1]; char ** knames=NULL; ygyoto_Astrobj_generic_eval_t * worker; @@ -125,25 +102,16 @@ } } - (*worker)(ao, kiargs, piargs, rvset, paUsed); + char * unit=NULL; + int k =-1; - } - static y_userobj_t gyoto_Astrobj_obj = - {const_cast("gyoto_Astrobj"), &gyoto_Astrobj_free, - &gyoto_Astrobj_print, &gyoto_Astrobj_eval, 0, 0}; + /* UNIT */ + YGYOTO_WORKER_SET_UNIT; -} + (*worker)(OBJ, kiargs+k+1, piargs, rvset, paUsed, unit); -SmartPointer* yget_Astrobj(int iarg) { - return &(((gyoto_Astrobj*)yget_obj(iarg, &gyoto_Astrobj_obj))->astrobj); -} - -SmartPointer* ypush_Astrobj() { - return &(((gyoto_Astrobj*)ypush_obj(&gyoto_Astrobj_obj, sizeof(gyoto_Astrobj)))->astrobj); -} + } -int yarg_Astrobj(int iarg) { - return yget_obj(iarg,0)==gyoto_Astrobj_obj.type_name; } @@ -159,9 +127,9 @@ ygyoto_Astrobj_evals[ygyoto_Astrobj_count++]=on_eval; } -void ygyoto_Astrobj_generic_eval(Gyoto::SmartPointer*ao, +void ygyoto_Astrobj_generic_eval(Gyoto::SmartPointer*OBJ, int *kiargs, int *piargs, - int *rvset, int *paUsed) { + int *rvset, int *paUsed, char * unit) { int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; @@ -172,134 +140,25 @@ << kiargs[i] << endl; /* METRIC */ - if ((iarg=*(kiargs++))>=0) { - iarg+=*rvset; - if (debug()) cerr << "in"; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - *ypush_Metric() = (*ao)->getMetric(); - } else - (*ao)->setMetric(*yget_Metric(iarg)) ; - if (debug()) cerr << "out"; - } + YGYOTO_WORKER_GETSET_OBJECT(Metric); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Rmax); + YGYOTO_WORKER_GETSET_LONG(Flag_radtransf); + YGYOTO_WORKER_XMLWRITE; - /* RMAX */ - if ((iarg=*(kiargs++))>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error("rmsg"); - ypush_double((*ao)->getRmax()); - } else - (*ao)->setRmax(ygets_d(iarg)); - } - - /* FLAG_RADTRANSF */ - if ((iarg=*(kiargs++))>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error("rmsg"); - ypush_long((*ao)->getFlag_radtransf()); - } else - (*ao)->setFlag_radtransf(ygets_l(iarg)); - } - - // Save to file - if ((iarg=*(kiargs++))>=0) { // xmlwrite - iarg+=*rvset; -#ifdef GYOTO_USE_XERCES - char *filename=ygets_q(iarg); - Factory(*ao).write(filename); -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } - - // kind - if ((iarg=*(kiargs++))>=0) { + // kind + if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (!yarg_nil(iarg)) y_error("KIND is readonly"); if (debug()) cerr << "kiargs=" << kiargs << endl; if ((*rvset)++) y_error(rmsg); char ** kind = ypush_q(0); - *kind = p_strcpy((*ao)->getKind().c_str()); + *kind = p_strcpy((*OBJ)->getKind().c_str()); } /* SETPARAMETER */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if ((*rvset)++) y_error("rmsg"); - if ((*paUsed)++) y_error("pmsg"); - string name = ygets_q(iarg); - string content = ygets_q(*piargs); - (*ao)->setParameter(name, content); - } - - /* CLONE */ - if ((iarg=kiargs[++k])>=0) { - if ((*rvset)++) y_error(rmsg); - *ypush_Astrobj() = (*ao)->clone(); - } + YGYOTO_WORKER_SETPARAMETER; + YGYOTO_WORKER_CLONE(Astrobj); if (debug()) cerr << "DEBUG: out of Astrobj_generic_eval"<< endl; } - -extern "C" { - void Y_gyoto_Astrobj(int argc) - { - int rvset[1]={0}, paUsed[1]={0}; - SmartPointer *ao = NULL; - // char *obj_type=(char*)yget_obj(argc-1,0); - // if (obj_type && //!strcmp(obj_type, "gyoto_Astrobj")) { - // if (yget_obj(argc-1,0) && yarg_typeid(argc-1)==Y_OPAQUE) { - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - *ypush_Astrobj() = *ao; // push back astrobj - } else { // Constructor mode - ao = ypush_Astrobj(); - *rvset=1; - } - - static char const * knames[]={ - YGYOTO_ASTROBJ_GENERIC_KW, - 0 - }; - static long kglobs[YGYOTO_ASTROBJ_GENERIC_KW_N+12]; - int kiargs[YGYOTO_ASTROBJ_GENERIC_KW_N+11]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - - // if rvset==1, constructor mode: - if (rvset[1]) { - if (yarg_string(piargs[0])) { -#ifdef GYOTO_USE_XERCES - try { *ao = Factory(ygets_q(piargs[0])).getAstrobj(); } - YGYOTO_STD_CATCH; - paUsed[1]=1; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else y_error("Cannot allocate object of virtual class Astrobj"); - } - - ygyoto_Astrobj_generic_eval(ao, kiargs, piargs, rvset, paUsed); - - } - - void - Y_is_gyoto_Astrobj(int argc) - { - ypush_long(yarg_Astrobj(0)); - } - -} diff -Nru gyoto-0.0.3/yorick/gyoto_Idx.C gyoto-0.1.0/yorick/gyoto_Idx.C --- gyoto-0.0.3/yorick/gyoto_Idx.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Idx.C 2013-07-27 09:14:20.000000000 +0000 @@ -24,11 +24,23 @@ int YGyoto::Idx::isNuller() {return _is_nuller;} long YGyoto::Idx::getNElements() {return _nel;} -long YGyoto::Idx::current() {return _cur;} +long YGyoto::Idx::current() { + if (_is_list) return _idx[_cur]; + return _cur; +} double YGyoto::Idx::getDVal() {return _is_double?_dval:_range[0];} int YGyoto::Idx::isDouble() {return _is_double;} +int YGyoto::Idx::isFirst() {return _is_first;} + +int YGyoto::Idx::isLast() { + if (_is_range) return _cur+_range[2] > _range[1]; + if (_is_scalar) return 1; + if (_is_list) return _cur >= _nel; + return 0; +} long YGyoto::Idx::first() { + _is_first=1; if (_is_range) return _cur=_range[0]; if (_is_scalar) return _cur=_range[0]; if (_is_list) return _idx[_cur=0]; @@ -44,6 +56,7 @@ } long YGyoto::Idx::next() { + _is_first=0; if (_is_range) return _cur+=_range[2]; if (_is_scalar) return ++_cur; if (_is_list && (++_cur)<_nel) return _idx[_cur]; diff -Nru gyoto-0.0.3/yorick/gyoto_Metric.C gyoto-0.1.0/yorick/gyoto_Metric.C --- gyoto-0.0.3/yorick/gyoto_Metric.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Metric.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -26,10 +26,17 @@ #endif #include +#include using namespace std; using namespace Gyoto; using namespace YGyoto; + +// Needed by the YGYOTO_WORKER_* macros + +YGYOTO_YUSEROBJ(Metric, Metric::Generic) +YGYOTO_BASE_CONSTRUCTOR(Metric) + static char ygyoto_Metric_names[YGYOTO_TYPE_LEN][YGYOTO_MAX_REGISTERED] ={{0}}; static ygyoto_Metric_eval_worker_t *ygyoto_Metric_evals[YGYOTO_MAX_REGISTERED] @@ -37,96 +44,39 @@ static int ygyoto_Metric_count=0; extern "C" { - typedef struct gyoto_Metric { SmartPointer metric; char type[YGYOTO_TYPE_LEN];} gyoto_Metric; - void gyoto_Metric_free(void *obj); - void gyoto_Metric_print(void *obj); - void gyoto_Metric_eval(void *obj, int n); - static y_userobj_t gyoto_Metric_obj = - {const_cast("gyoto_Metric"), &gyoto_Metric_free, &gyoto_Metric_print, &gyoto_Metric_eval, 0, 0}; - - // METRIC CLASS - void gyoto_Metric_free(void *obj) { - if (((gyoto_Metric*)obj)->metric) { - ((gyoto_Metric*)obj)->metric=NULL; - } else printf("null pointer\n"); - } - - void gyoto_Metric_print(void *obj) { -#ifdef GYOTO_USE_XERCES - string rest="", sub=""; - try { rest = Factory(((gyoto_Metric*)obj)->metric).format(); } - YGYOTO_STD_CATCH; - size_t pos=0, len=0; - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); - } -#else - y_print("GYOTO metric of type ",0); - SmartPointer gg = ((gyoto_Metric*)obj)->metric; - y_print(gg->getKind().c_str(),0); -#endif - } - void gyoto_Metric_eval(void *obj, int argc) { - SmartPointer gg = ((gyoto_Metric*)obj)->metric; + SmartPointer *OBJ_ = &((gyoto_Metric*)obj)->smptr; // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { - ypush_long( (long) gg() ); + ypush_long( (long) (*OBJ_)() ); return; } // Try calling kind-specific worker int n=0; - const string kind = gg->getKind(); + const string kind = (*OBJ_)->getKind(); while (n(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Metric takes at most 4 positional arguments"); - } - } - int rvset[1]={0}, paUsed[1]={0}; - ygyoto_Metric_generic_eval(&gg, kiargs, piargs, rvset, paUsed); - } -} + YGYOTO_WORKER_INIT(Metric, Generic, knames, YGYOTO_METRIC_GENERIC_KW_N+1); -// PUBLIC API + YGYOTO_WORKER_SET_UNIT; -SmartPointer *yget_Metric(int iarg) { - return &((gyoto_Metric*)yget_obj(iarg, &gyoto_Metric_obj))->metric; -} + YGYOTO_WORKER_CALL_GENERIC(Metric); -SmartPointer *ypush_Metric() { - gyoto_Metric* obj = (gyoto_Metric*)ypush_obj(&gyoto_Metric_obj, sizeof(gyoto_Metric)); - return &(obj->metric); -} - -int yarg_Metric(int iarg) { - return yget_obj(iarg,0)==gyoto_Metric_obj.type_name; + } } void ygyoto_Metric_register(char const*const name, ygyoto_Metric_eval_worker_t* on_eval){ @@ -143,9 +93,9 @@ // strcpy(ygyoto_Metric_names[ygyoto_Metric_count], ""); } -void ygyoto_Metric_generic_eval(Gyoto::SmartPointer*gg, +void ygyoto_Metric_generic_eval(SmartPointer*OBJ, int *kiargs, int *piargs, - int *rvset, int *paUsed) { + int *rvset, int *paUsed, char * unit) { int k=-1, iarg=-1; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; @@ -160,7 +110,7 @@ if (ntot!=4) y_error("POS must have 4 elements"); double * vel=ygeta_d(piargs[0],&ntot,0); if (ntot!=3) y_error("VEL must have 3 elements"); - ypush_double((*gg)->SysPrimeToTdot(pos, vel)); + ypush_double((*OBJ)->SysPrimeToTdot(pos, vel)); } if ((iarg=kiargs[++k])>=0) { // nullifycoord @@ -175,7 +125,7 @@ double *coord = ypush_d(dims); for (int i=0; i<4; ++i) coord[i]=pos[i]; for (int i=0; i<3; ++i) coord[i+5]=vel[i]; - (*gg)->nullifyCoord(coord); + (*OBJ)->nullifyCoord(coord); } // kind @@ -183,28 +133,40 @@ if ((*rvset)++) y_error(rmsg); if (!yarg_nil(iarg)) y_error("KIND is readonly"); char ** kind = ypush_q(0); - *kind = p_strcpy((*gg)->getKind().c_str()); + *kind = p_strcpy((*OBJ)->getKind().c_str()); } - // Process SET keywords + YGYOTO_WORKER_SETPARAMETER; + + // ScalarProd if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // mass= : get mass - if ((*rvset)++) y_error(rmsg); - ypush_double((*gg)->getMass()); - } else // mass=m: set mass - (*gg)->setMass(ygets_d(iarg)) ; + if ((*rvset)++) y_error(rmsg); + if ((*paUsed)++) y_error(pmsg); + long ntot=0; + long dims[Y_DIMSIZE]; + double * pos = ygeta_d(iarg, &ntot, dims); + if (!dims[0] || dims[1]<4) + y_error("scalarprod: pos must be at least 4 elements long"); + double * u1 = ygeta_d(piargs[0], &ntot, dims); + if (!dims[0] || dims[1]<4) + y_error("scalarprod: u1 must be at least 4 elements long"); + double * u2 = ygeta_d(piargs[1], &ntot, dims); + if (!dims[0] || dims[1]<4) + y_error("scalarprod: u2 must be at least 4 elements long"); + ypush_double((*OBJ)->ScalarProd(pos, u1, u2)); } + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Mass); + // Unit length if ((iarg=kiargs[++k])>=0) { // unitLength() if ((*rvset)++) y_error(rmsg); if (!yarg_nil(iarg)) y_error("UNITLENGTH is readonly"); - ypush_double((*gg)->unitLength()); + ypush_double((*OBJ)->unitLength(unit?unit:"")); } // circularvelocity - if ((iarg=kiargs[++k])>=0) { // unitLength() + if ((iarg=kiargs[++k])>=0) { if ((*rvset)++) y_error(rmsg); if ((*paUsed)++) y_error(pmsg); long ntot=0; @@ -219,25 +181,11 @@ dims[1]=4; double * vels = ypush_d(dims); for (long i=0; icircularVelocity(coords, vels, dir); + (*OBJ)->circularVelocity(coords, vels, dir); } - // Save to file - if ((iarg=kiargs[++k])>=0) { // xmlwrite - iarg+=*rvset; - char *filename=ygets_q(iarg); -#ifdef GYOTO_USE_XERCES - Factory(*gg).write(filename); -#else - y_error("This GYOTO was compiled without xerces: no xml i/o"); -#endif - } - - /* CLONE */ - if ((iarg=kiargs[++k])>=0) { - if ((*rvset)++) y_error(rmsg); - *ypush_Metric() = (*gg)->clone(); - } + YGYOTO_WORKER_XMLWRITE; + YGYOTO_WORKER_CLONE(Metric); if (*rvset || *paUsed || piargs[0]<0 || !yarg_number(piargs[0])) return; //else /* GET G MU NU */ @@ -263,68 +211,6 @@ size_t i, j; for ( j=j_idx.first() ; j_idx.valid() ; j=j_idx.next() ) for ( i=i_idx.first() ; i_idx.valid() ; i=i_idx.next() ) - *(data++) = (*gg)->gmunu(x, i-1, j-1); - -} - - -// YAPI FUNCTIONS - -extern "C" { - - void Y_gyoto_Metric(int argc) { - int rvset[1]={0}, paUsed[1]={0}; - SmartPointer *gg = NULL; - int builder=0; - - if (yarg_Metric(argc-1)) { - gg = yget_Metric(--argc); - // Try calling kind-specific worker - int n=0; - const string kind = (*gg)->getKind(); - while (n(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Metric takes at most 4 positional arguments"); - } - } - - // if builder==1, constructor mode: - if (builder) { - if (yarg_string(piargs[0])) { -#ifdef GYOTO_USE_XERCES - try { *gg = Factory(ygets_q(piargs[0])).getMetric(); } - YGYOTO_STD_CATCH; - paUsed[1]=1; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else y_error("Cannot allocate object of virtual class Metric"); - } - - ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed); - } + *(data++) = (*OBJ)->gmunu(x, i-1, j-1); } diff -Nru gyoto-0.0.3/yorick/gyoto_Photon.C gyoto-0.1.0/yorick/gyoto_Photon.C --- gyoto-0.0.3/yorick/gyoto_Photon.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Photon.C 2013-07-27 09:14:20.000000000 +0000 @@ -22,15 +22,18 @@ #include "GyotoDefs.h" #include "ygyoto.h" #include "yapi.h" +#include "pstdlib.h" + +#define OBJ ph using namespace Gyoto; using namespace std; -#define YGYOTO_PHOTON_GENERIC_KW "metric", "initcoord", "astrobj", \ - "spectro", \ - "xfill", "save_txyz", "xmlwrite", "is_hit", \ +#define YGYOTO_PHOTON_GENERIC_KW "unit", "metric", "initcoord", "astrobj", \ + "spectro", "tmin", "delta", "adaptive", "maxiter", "setparameter", \ + "reset", "xfill", "save_txyz", "xmlwrite", "is_hit", \ "get_txyz", "get_coord", "get_cartesian", "clone" -#define YGYOTO_PHOTON_GENERIC_KW_N 12 +#define YGYOTO_PHOTON_GENERIC_KW_N 19 void ygyoto_Photon_generic_eval(Gyoto::SmartPointer* ph, int *kiargs, int *piargs, int *rvset, int *paUsed) { @@ -38,19 +41,10 @@ int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; + char * unit = NULL; - //// MEMBERS //// - /* METRIC */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (debug()) cerr << "metric="; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - *ypush_Metric()=(*ph)->getMetric(); - } else - (*ph)->setMetric(*yget_Metric(iarg)) ; - if (debug()) cerr << "... "; - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_OBJECT(Metric); /* INITCOORD */ if ((iarg=kiargs[++k])>=0) { @@ -116,42 +110,15 @@ if (debug()) cerr << "... " << endl; } - /* ASTROBJ */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (debug()) cerr << "astrobj="; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - *ypush_Astrobj() = (*ph)->getAstrobj(); - } else - (*ph) -> setAstrobj( *yget_Astrobj(iarg) ) ; - if (debug()) cerr << "... " << endl; - } - - /* SPECTRO */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - *ypush_Spectrometer() = (*ph) -> getSpectrometer(); - } else { - (*ph) -> setSpectrometer(*yget_Spectrometer(iarg)); - } - } - - - - //// METHODS //// - // SUBROUTINE-LIKE // - // xfill=tlim: integrate geodesic - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (debug()) cerr << "xfill="; - double tlim = ygets_d(iarg); - if (debug()) cerr << tlim; - (*ph)->xFill(tlim); - if (debug()) cerr << "... " << endl; - } + YGYOTO_WORKER_GETSET_OBJECT(Astrobj); + YGYOTO_WORKER_GETSET_OBJECT(Spectrometer); + YGYOTO_WORKER_GETSET_DOUBLE(Tmin); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Delta); + YGYOTO_WORKER_GETSET_LONG2(adaptive); + YGYOTO_WORKER_GETSET_LONG2( maxiter ); + YGYOTO_WORKER_SETPARAMETER; + YGYOTO_WORKER_RUN( reset() ); + YGYOTO_WORKER_RUN( xFill(ygets_d(iarg)) ); // save_txyz=filename, t1, mass_sun, distance_kpc, unit, screen if ((iarg=kiargs[++k])>=0) { @@ -186,22 +153,11 @@ if (debug()) cerr << filename << endl ; } - // Save to file - if ((iarg=kiargs[++k])>=0) { // xmlwrite - iarg+=*rvset; - if (debug()) cerr << " xmlwrite="; -#ifdef GYOTO_USE_XERCES - char *filename=ygets_q(iarg); - Factory(*ph).write(filename); - if (debug()) cerr << filename << endl; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } + YGYOTO_WORKER_XMLWRITE; // FUNCTION-LIKE // - /* is_hit= */ + /* IS_HIT= */ if ((iarg=kiargs[++k])>=0) { // is_hit=whatever if (debug()) cerr << " is_hit=" << endl; if ((*rvset)++) y_error(rmsg); @@ -222,7 +178,8 @@ (*ph)->get_xyz(data+nel, data+2*nel, data+3*nel); } - if ((iarg=kiargs[++k])>=0) { // get_coord + /* GET_COORD */ + if ((iarg=kiargs[++k])>=0) { if (debug()) cerr << " get_coord=dates" << endl; if ((*rvset)++) y_error(rmsg); // Two cases : get_coord=1 or get_coord=dates. @@ -293,53 +250,22 @@ } - /* CLONE */ - if ((iarg=kiargs[++k])>=0) { - if ((*rvset)++) y_error(rmsg); - *ypush_Photon() = (*ph)->clone(); - } + YGYOTO_WORKER_CLONE(Photon); if (debug()) cerr << endl; } +YGYOTO_YUSEROBJ(Photon, Photon) extern "C" { - -// PHOTON CLASS - -// Photon() -// setInitialCondition(Metric*, Astrobj*, coord[8], sys); -// setDelta(double) -// hit(double) - typedef struct gyoto_Photon { SmartPointer photon; } gyoto_Photon; - void gyoto_Photon_free(void *obj) { - if (((gyoto_Photon*)obj)->photon) { - ((gyoto_Photon*)obj)->photon=NULL; - } else printf("null pointer\n"); - } - void gyoto_Photon_print(void *obj) { -#ifdef GYOTO_USE_XERCES - string rest="", sub=""; - size_t pos=0, len=0; - try {rest = Factory(((gyoto_Photon*)obj)->photon).format();} - YGYOTO_STD_CATCH; - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); - } -#else - y_print("GYOTO photon",0); -#endif - } void gyoto_Photon_eval(void *obj, int argc) { // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { - ypush_long((long)((gyoto_Photon*)obj)->photon()); + ypush_long((long)((gyoto_Photon*)obj)->smptr()); return; } - SmartPointer *ph = &(((gyoto_Photon*)obj)->photon); + SmartPointer *ph = &(((gyoto_Photon*)obj)->smptr); static char const * knames[]={ YGYOTO_PHOTON_GENERIC_KW, 0 @@ -363,122 +289,16 @@ int rvset[1]={0}, paUsed[1]={0}; ygyoto_Photon_generic_eval(ph, kiargs, piargs, rvset, paUsed); - } - static y_userobj_t gyoto_Photon_obj = - {const_cast("gyoto_Photon"), &gyoto_Photon_free, &gyoto_Photon_print, &gyoto_Photon_eval, 0, 0}; - + // Generic constructor/accessor void Y_gyoto_Photon(int argc) { - int rvset[1]={0}, paUsed[1]={0}, builder=0; - SmartPointer *ph = NULL; - if (yarg_Photon(argc-1)) { // photon on the stack - ph = yget_Photon(--argc); - *ypush_Photon() = *ph; // push back photon on the stack - } else { // constructor mode - ph = ypush_Photon(); - builder=1; - } - - static char const * knames[]={ - YGYOTO_PHOTON_GENERIC_KW, 0 - }; - static long kglobs[YGYOTO_PHOTON_GENERIC_KW_N+1]; - int kiargs[YGYOTO_PHOTON_GENERIC_KW_N]; - int piargs[]={-1,-1,-1,-1}; - // push default return value: need to drop before pushing another one - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Photon takes at most 4 positional arguments"); - } - } - - // if rvset==1, constructor mode: - if (builder) { - if (yarg_string(piargs[0])) { -#ifdef GYOTO_USE_XERCES - // try { *ao_ = Factory(ygets_q(piargs[0])).getAstrobj(); } - // YGYOTO_STD_CATCH; - *paUsed=1; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else *ph = new Photon(); - } - - ygyoto_Photon_generic_eval(ph, kiargs, piargs, rvset, paUsed); - + YGYOTO_CONSTRUCTOR_INIT1(Photon, Photon, Photon); + gyoto_Photon_eval(OBJ, argc); } - void - Y_gyoto_Photon_new(int n) - { - gyoto_Photon * obj=(gyoto_Photon*)ypush_obj(&gyoto_Photon_obj, sizeof(gyoto_Photon)); - try { obj->photon = new Photon(); } - YGYOTO_STD_CATCH ; - } - - void - Y_gyoto_Photon_setInitialCondition(int n) - { //(Metric*, Astrobj*, coord[8], sys); - gyoto_Photon *phobj =(gyoto_Photon*) yget_obj(n-1, &gyoto_Photon_obj); - SmartPointer *gg = yget_Metric(n-2); - SmartPointer *astrobj = yget_Astrobj(n-3); - - if (n==4) { - long ntot=1; - double * coord = ygeta_d(n-4, &ntot, NULL); - if (ntot < 4) y_error("coord must have at least 4 elements"); - try { - (phobj->photon)->setInitialCondition(*gg, *astrobj, coord); - } YGYOTO_STD_CATCH ; - } else if (n==6) { - SmartPointer *screen = yget_Screen(n-4); - double d_alpha = ygets_d(n-5); - double d_delta = ygets_d(n-6); - try { - (phobj->photon)->setInitialCondition(*gg, *astrobj, *screen, d_alpha, d_delta); - } YGYOTO_STD_CATCH ; - } else y_error("gyoto_Photon_setInitialCondition takes either 4 or 7 arguments"); - } - - void - Y_gyoto_Photon_setDelta(int n) - { //(Metric*, Astrobj*, coord[8], sys); - gyoto_Photon * phobj =(gyoto_Photon*)yget_obj(n-1, &gyoto_Photon_obj); - double delta=ygets_d(n-2); - try { - (phobj->photon)->setDelta(delta); - } YGYOTO_STD_CATCH ; - } - - void - Y_gyoto_Photon_hit(int n) - { //(Metric*, Astrobj*, coord[8], sys); - gyoto_Photon * phobj =(gyoto_Photon*)yget_obj(n-1, &gyoto_Photon_obj); - double tlim=ygets_d(n-2); - ypush_int((phobj->photon)->hit(NULL)); - } - -} - -SmartPointer* yget_Photon(int iarg) { - return &(((gyoto_Photon*)yget_obj(iarg, &gyoto_Photon_obj))->photon); -} - -SmartPointer* ypush_Photon() { - return &(((gyoto_Photon*)ypush_obj(&gyoto_Photon_obj, sizeof(gyoto_Photon)))->photon); -} - -int yarg_Photon(int iarg) { - return yget_obj(iarg,0)==gyoto_Photon_obj.type_name; } diff -Nru gyoto-0.0.3/yorick/gyoto_Photon.i gyoto-0.1.0/yorick/gyoto_Photon.i --- gyoto-0.0.3/yorick/gyoto_Photon.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Photon.i 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -plug_in, "gyoto"; -/* - Copyright 2011 Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - - -// PHOTON CLASS -extern gyoto_Photon; -/* DOCUMENT photon = gyoto_Photon([filename], [members=values]) - photon, member=values - value = photon(member=) - value = photon(function_method=params) - photon, subroutine_method=params - - PURPOSE: - - Instanciate and use a single GYOTO photon. - - Photons are mass-less particles following light-like geodesics of - a metric. For basic concepts, see GYOTO. For ray-tracing, - gyoto_Scenery() is more appropriate. - - MEMBERS: - - Members can be set with the syntax "photon, member=value" and - retrieved with the syntax "value=photon(member=)": - - metric= a GYOTO Metric (see gyoto_Metric), - initcoord=scenery,x,y also sets the metric. - astrobj=a GYOTO Astrobj (see gyoto_Astroj), the target of - ray-tracing. - - initcoord= the initial coordinates (4-position & 4 velocity). - There are many ways to specify this: - - initcoord=COORD8 - directly give the 8 coordinates; - initcoord=POS4,VEL4 - as above, with a coma in-between; - initcoord=POS4,VEL3 this time only 3 coordinates are given - for the velocity vector. The light-ray will be tangent - to this 3-vector. - initcoord=SCREEN,DALPHA,DDELTA - SCREEN is a gyoto_Screen, DALPHA and DDELTA specify - the direction this photon comes from when it reaches - the screen. DALPHA and DDELTA are in radians and must - be floating-point values. - initcoord=SCREEN,I,J - As above, but I and J are integers specifying the - pixel of the arrival SCREEN which the photon hits. - initcoord=SCENERY,DALPHA,DDELTA - initcoord=SCENERY,I,J - As above, but specify a gyoto_Scenery instead of a - gyoto_Screen. The Metric and Astrobj of the Senery - will also be attached to the Photon. - - Those last ways of specifying the initial conditions are - very useful to get the trajectory of a specific photon in - a ray-traced scenery. - - spectro= a gyoto_Spectrometer - - - SUBROUTNIE-LIKE METHODS: - - Several of these keywords can by specified whenever creating or - accessing the object. - - xfill=TLIM Integrate the geodesic from the time specified with - INITCOORD to tlim (the integrated geodesic remains stored - in the PHOTON); - - save_txyz=FILENAME Dump the integrated geodesic in cartesian - coordinates in ASCII file FILENAME. - - xmlwrite=filename as usual, save an XML description of this - photon; - - FUNCTION-LIKE METHODS: - - The object PHOTON will return a value when called as a function - with the following keywords set: - - is_hit= Return 1 if this photon hits the Astrobj - - get_txyz= Return the geodesic in Cartesian coordinates: - data = photon(xfill=tlim, get_txyz=) - data will be a Nx4 double array where data(i,) contains - the 4-position in Cartesian coordinates of the photon for - all the dates computed by the integrator between - INITCOORD[0] and TLIM. - - get_coord= Return the geodesic in Metric coordinatess: same as - above, but in the prefered coordinate system for this - metric, which may be Cartesian or spherical. - - get_coord=dates Same as above, but for the dates specified in - double array DATES. - - get_cartesian=dates Get the 3-position and 3-velocity of the - Photon in Cartesian coordinates for the specified dates. - - SEE ALSO: gyoto, gyoto_Metric, gyoto_Screen, gyoto_Scenery, - gyoto_Astrobj - */ - - -extern gyoto_Photon_new; -/* DOCUMENT photon = gyoto_Photon_new() - - SEE ALSO: - */ - -extern gyoto_Photon_setInitialCondition; -/* DOCUMENT gyoto_Photon_setInitialCondition, photon, metric, astrobj, coord - or gyoto_Photon_setInitialCondition, photon, metric, astrobj, t0, dalpha, ddelta - SEE ALSO: - */ - -extern gyoto_Photon_setDelta; -/* DOCUMENT gyoto_Photon_setDelta, photon, deltatau - - SEE ALSO: - */ - -extern gyoto_Photon_hit; -/* DOCUMENT hit = gyoto_Photon_hit(photon, tlim) - - SEE ALSO: - */ - diff -Nru gyoto-0.0.3/yorick/gyoto_Scenery.C gyoto-0.1.0/yorick/gyoto_Scenery.C --- gyoto-0.0.3/yorick/gyoto_Scenery.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Scenery.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -29,174 +29,172 @@ #include "ygyoto.h" #include +#include #include "ygyoto_idx.h" +#ifdef HAVE_PTHREAD +#include +#endif + using namespace std; using namespace Gyoto; using namespace YGyoto; -extern "C" { +typedef struct ySceneryThreadWorkerArg { +#ifdef HAVE_PTHREAD + pthread_mutex_t * mutex; + pthread_t * parent; +#endif + Idx *i_idx, *j_idx; + Scenery *sc; + Photon * ph; + Astrobj::Properties *data; + double * impactcoords; + size_t res; +} ySceneryThreadWorkerArg ; + +static void * ySceneryThreadWorker (void *arg) { + /* + This is the real ray-tracing loop. It may be called by multiple + threads in parallel, launched from ::rayTrace + */ + + ySceneryThreadWorkerArg *larg = static_cast(arg); + + // Each thread needs its own Photon, clone cached Photon + // it is assumed to be already initialized with spectrometer et al. + Photon * ph = larg -> ph; +#ifdef HAVE_PTHREAD + if (larg->mutex) { + GYOTO_DEBUG << "locking mutex\n"; + pthread_mutex_lock(larg->mutex); + GYOTO_DEBUG << "mutex locked\n"; + ph = larg -> ph -> clone(); + GYOTO_DEBUG << "unlocking mutex\n"; + pthread_mutex_unlock(larg->mutex); + GYOTO_DEBUG << "mutex unlocked\n"; + } +#endif - void* _ypush_Scenery(); - void* _yget_Scenery(int iarg); - int _yarg_Scenery(int iarg); + // local variables to store our parameters + size_t i, j; + Astrobj::Properties data; + double * impactcoords = NULL; + + size_t count=0; + + while (1) { + /////// 1- get input and output parameters and update them for next access + //// i and j are input, data and impactcoords are where to store + //// output. we must get them and increase them so that another + //// thread can get the next values while we integrate. +#ifdef HAVE_PTHREAD + // lock mutex so we can safely read and update i, j et al. + if (larg->mutex) pthread_mutex_lock(larg->mutex); +#endif + // copy i & j + i = larg->i_idx->current(); j = larg->j_idx->current(); - void Y_gyoto_Scenery(int); + // check whether there remains something to compute + if (!larg->j_idx->valid() + || (larg->j_idx->isLast() && !larg->i_idx->valid())) { + // terminate, but first... +#ifdef HAVE_PTHREAD + // ...unlock mutex so our siblings can access i & j and terminate too + if (larg->mutex) pthread_mutex_unlock(larg->mutex); +#endif + break; + } - // SCENERY CLASS - // Opaque Yorick object - typedef struct gyoto_Scenery { - SmartPointer scenery; - // char type[YGYOTO_TYPE_LEN]; - } gyoto_Scenery; - void gyoto_Scenery_free(void *obj) { - if (((gyoto_Scenery*)obj)->scenery) { - ((gyoto_Scenery*)obj)->scenery = NULL; - } else printf("Freeing unattached Scenery object\n"); - } - void gyoto_Scenery_print(void *obj) { - GYOTO_DEBUG << endl; -#ifdef GYOTO_USE_XERCES - if (debug()) { - cerr << "DEBUG: Printing Gyoto Scenery"<scenery()<i_idx->isFirst() && + verbose() >= GYOTO_QUIET_VERBOSITY && !impactcoords) { + cout << "\rRay-tracing scenery: j = " << j << flush ; } - string rest = Factory(((gyoto_Scenery*)obj)->scenery).format(), sub=""; - if (debug()) - cerr << "DEBUG: Printing" << endl; - size_t pos=0, len; - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); +# if GYOTO_DEBUG_ENABLED + GYOTO_DEBUG << "i = " << i << ", j = " << j << endl; +# endif + + // update i & j + larg->i_idx->next(); + if (!larg->i_idx->valid()) { + larg->j_idx->next(); larg->i_idx->first(); } -#else - y_print("GYOTO Scenery object",0); - // y_print(((gyoto_Scenery*)obj)->type,0); + + // copy output pointers and update them + data = *larg->data; ++(*larg->data); + if (larg->impactcoords) impactcoords=larg->impactcoords+((j-1)*larg->res+i-1)*16; + +#ifdef HAVE_PTHREAD + // unlock mutex so our siblings can can access i, j et al. and procede + if (larg->mutex) pthread_mutex_unlock(larg->mutex); #endif + + ////// 2- do the actual work. + (*larg->sc)(i, j, &data, impactcoords, ph); + ++count; + } +#ifdef HAVE_PTHREAD + if (larg->mutex) { + delete ph; + pthread_mutex_lock(larg->mutex); } - void gyoto_Scenery_eval(void *obj, int n) { - int rvset[1]={0}, paUsed[1]={0}, builder=0; - gyoto_Scenery *s_obj = (gyoto_Scenery*)obj; + GYOTO_MSG << "\nThread terminating after integrating " << count << " photons"; + if (larg->mutex) pthread_mutex_unlock(larg->mutex); +# endif + return NULL; +} + +YGYOTO_YUSEROBJ(Scenery, Scenery) + +extern "C" { + + void Y_gyoto_Scenery(int); + + void gyoto_Scenery_eval(void *obj, int argc) { + SmartPointer *OBJ_ = &(((gyoto_Scenery*)obj)->smptr); + double * impactcoords = NULL; bool precompute = 0; - if (!s_obj) { - builder=1; - s_obj = (gyoto_Scenery*)(obj=_ypush_Scenery()); - } else { - *ypush_Scenery()=s_obj->scenery; - } - - // Parse keywords static char const *knames[] = { "get_pointer", - "metric", "screen", "astrobj", "delta", "quantities", + "unit", + "metric", "screen", "astrobj", "delta", "tmin", "quantities", "adaptive", + "maxiter=", "xmlwrite", "clone", - "impactcoords", + "impactcoords", "nthreads", 0 }; - static long kglobs[10]; - int kiargs[9], piargs[]={-1, -1, -1}; - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=n, parg=0; - - while (iarg>0) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<3) piargs[parg++]=iarg--; - else - y_error("gyoto_Scenery::eval takes at most 3 positional arguments"); - } - } - if (builder) { - if (yarg_string(piargs[0])) { - if (debug()) - cerr << "DEBUG: gyoto_Scenery() creating new Scenery from file\n"; -#ifdef GYOTO_USE_XERCES - Factory *factory = new Factory(ygets_q(piargs[0])); - string kind=""; - kind = factory->getKind(); - if (kind.compare("Scenery")) - y_error("Only Scenery supported when reading XML"); - s_obj->scenery = factory -> getScenery(); - delete factory; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else { - if (debug()) - cerr << "DEBUG: gyoto_Scenery() creating new empty Scenery\n"; - s_obj->scenery=new Scenery(); - } - } - SmartPointer sc=s_obj->scenery; - int k=-1; + YGYOTO_WORKER_INIT1(Scenery, Scenery, knames, 14) - // Get one member - if (yarg_true(kiargs[++k])) { // get pointer + // Get pointer + if (yarg_true(kiargs[++k])) { if ((*rvset)++) y_error("Only one return value possible"); - yarg_drop(1); - ypush_long((long)(sc())); + ypush_long((long)((*OBJ)())); } - ///////// ACCESSORS ////////// - /* METRIC */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // metric=: Getting - if ((*rvset)++) y_error("Only one return value possible"); - (*ypush_Metric()) = sc->getMetric(); - } else sc->setMetric(*yget_Metric(iarg)); - } - - /* SCREEN */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // screen=: Getting - if ((*rvset)++) y_error("Only one return value possible"); - *ypush_Screen()=sc->getScreen(); - } else // Setting - sc->setScreen(*yget_Screen(iarg)); - } - - /* ASTROBJ */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // astrobj= : Getting - if ((*rvset)++) y_error("Only one return value possible"); - *ypush_Astrobj()=sc->getAstrobj(); - } else // astrobj=ao: Setting - sc->setAstrobj(*yget_Astrobj(iarg)); - } - - /* DELTA */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // delta= : Getting - if ((*rvset)++) y_error("Only one return value possible"); - ypush_double(sc->getDelta()); - } else // delta=double: Setting - sc->setDelta(ygets_d(iarg)); - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_OBJECT(Metric); + YGYOTO_WORKER_GETSET_OBJECT(Screen); + YGYOTO_WORKER_GETSET_OBJECT(Astrobj); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Delta); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Tmin); /* QUANTITIES */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (yarg_nil(iarg)) { // quantities= : Getting if ((*rvset)++) y_error("Only one return value possible"); - Quantity_t quant = sc->getRequestedQuantities(); - size_t nk = sc->getScalarQuantitiesCount(); + Quantity_t quant = (*OBJ)->getRequestedQuantities(); + size_t nk = (*OBJ)->getScalarQuantitiesCount(); long rquant = nk>1?1:0; long dims[2] = { rquant, nk }; ystring_t *squant = ypush_q(dims); size_t k = 0; char *tk = - strtok(const_cast(sc->getRequestedQuantitiesString().c_str()), + strtok(const_cast((*OBJ)->getRequestedQuantitiesString().c_str()), " \n\t"); while (tk!=NULL) { if (k>=nk) y_error("BUG: too many tokens in quantity list"); @@ -211,26 +209,14 @@ quants += " "; quants += squant[k]; } - sc -> setRequestedQuantities(quants); + (*OBJ) -> setRequestedQuantities(quants); } } - // Save to file - if ((iarg=kiargs[++k])>=0) { // xmlwrite - iarg+=*rvset; -#ifdef GYOTO_USE_XERCES - char *filename=ygets_q(iarg); - Factory(sc).write(filename); -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } - - /* CLONE */ - if ((iarg=kiargs[++k])>=0) { - if ((*rvset)++) y_error("Only one return value possible"); - *ypush_Scenery() = sc->clone(); - } + YGYOTO_WORKER_GETSET_LONG2( adaptive ); + YGYOTO_WORKER_GETSET_LONG2( maxiter ); + YGYOTO_WORKER_XMLWRITE; + YGYOTO_WORKER_CLONE(Scenery); /* IMPACTCOORDS */ if ((iarg=kiargs[++k])>=0) { @@ -240,25 +226,27 @@ } else { // impaccoords=double(16,res,res): Setting long ntot; long dims[Y_DIMSIZE]; - size_t res=sc->getScreen()->getResolution(); + size_t res=(*OBJ)->getScreen()->getResolution(); impactcoords = ygeta_d(iarg, &ntot, dims); if (dims[0] != 3 || dims[1] != 16 || dims[2] != res || dims[3] != res) y_error("dimsof(impactcoords) != [3,16,res,res]"); } } + YGYOTO_WORKER_GETSET_LONG(NThreads); + // Get ray-traced image if there is a supplementary positional argument - if (!builder && // don't ray-trace on construction... + if ( !*rvset && // has a return value already been set? - (((n<=3 && piargs[n-1]>=0) || (piargs[1]>=0)) // positional argument? + (((argc>0 && argc<=3 && piargs[argc-1]>=0) || (piargs[1]>=0)) // positional argument? || precompute || impactcoords) ) { - size_t res=sc->getScreen()->getResolution(); + size_t res=(*OBJ)->getScreen()->getResolution(); if ((*rvset)++) y_error("Only one return value possible"); if ((*paUsed)++) y_error("Only one keyword may use positional arguments"); GYOTO_DEBUG << "rank: " << yarg_rank(piargs[0]) << endl; - SmartPointer spr = sc->getScreen()->getSpectrometer(); + SmartPointer spr = (*OBJ)->getScreen()->getSpectrometer(); size_t nbnuobs = spr()? spr->getNSamples() : 0; Idx i_idx (piargs[0], res); @@ -272,8 +260,8 @@ long nk = 0; int rquant = 0; ystring_t * squant = NULL; if (piargs[2] < 0 || yarg_nil(piargs[2])) { - Quantity_t quant = sc->getRequestedQuantities(); - nk = sc->getScalarQuantitiesCount(); + Quantity_t quant = (*OBJ)->getRequestedQuantities(); + nk = (*OBJ)->getScalarQuantitiesCount(); if (quant & GYOTO_QUANTITY_SPECTRUM) nk += 1; if (quant & GYOTO_QUANTITY_BINSPECTRUM) nk += 1; rquant = nk>1?1:0; @@ -281,7 +269,7 @@ squant = ypush_q(dims); size_t k = 0; char *tk = - strtok(const_cast(sc->getRequestedQuantitiesString().c_str()), + strtok(const_cast((*OBJ)->getRequestedQuantitiesString().c_str()), " \n\t"); while (tk!=NULL) { if (k>=nk) y_error("BUG: too many tokens in quantity list"); @@ -297,14 +285,39 @@ } size_t k; int has_sp=0, has_bsp=0; + string tkk="", qunit="", quantity="", intu, spu, bspu; + size_t first = 0, last = 0; if (nbnuobs) for (k=0; k screen = (*OBJ) -> getScreen(); +# ifdef HAVE_UDUNITS + if (data) (*OBJ)->setPropertyConverters(&prop); + screen->mapPixUnit(); + if (intu != "") prop.setIntensityConverter(intu); + if (spu != "") prop.setSpectrumConverter(spu); + if (bspu != "") prop.setBinSpectrumConverter(bspu); + screen->unmapPixUnit(); +# endif + size_t i, j; if (precompute) prop.impactcoords=data; else { @@ -389,94 +412,161 @@ } if (i_idx.isDouble() ||j_idx.isDouble()) { prop.init(nbnuobs); - Photon ph(sc->getMetric(), sc->getAstrobj(), sc->getScreen(), + Photon ph((*OBJ)->getMetric(), (*OBJ)->getAstrobj(), screen, i_idx.getDVal(), j_idx.getDVal()); + ph.adaptive((*OBJ)->adaptive()); ph.hit(&prop); } else { - for (j=j_idx.first() ; - j_idx.valid() ; - j=j_idx.next() ) { - if (impactcoords==NULL) - cout << "\rRay-tracing scenery: j = " << j << flush ; - for (i=i_idx.first(); - i_idx.valid(); - i=i_idx.next() ) { - GYOTO_DEBUG << "j="< computeBaseVectors(); + double coord[8]; + screen -> getRayCoord(size_t(i_idx.first()), + size_t(j_idx.first()), + coord); + Photon ph((*OBJ)->getMetric(), (*OBJ)->getAstrobj(), coord); + ph.setSpectrometer(screen->getSpectrometer()); + ph.setFreqObs(screen->getFreqObs()); + ph.adaptive((*OBJ)->adaptive()); + + ySceneryThreadWorkerArg larg; + larg.sc=(*OBJ); + larg.ph=&ph; + larg.data=∝ + larg.impactcoords=impactcoords; + larg.i_idx=&i_idx; + larg.j_idx=&j_idx; + larg.res=res; + +# ifdef HAVE_PTHREAD + larg.mutex = NULL; + pthread_mutex_t mumu = PTHREAD_MUTEX_INITIALIZER; + pthread_t * threads = NULL; + pthread_t pself = pthread_self(); + larg.parent = &pself; + size_t nthreads = (*OBJ) -> getNThreads(); + if (nthreads >= 2) { + threads = new pthread_t[nthreads-1]; + larg.mutex = &mumu; + for (size_t th=0; th < nthreads-1; ++th) { + if (pthread_create(threads+th, NULL, + ySceneryThreadWorker, + static_cast(&larg)) < 0) + y_error("Error creating thread"); } } - if (impactcoords==NULL) cout << endl; - } - } - } +# endif - static y_userobj_t gyoto_Scenery_obj = { - const_cast("gyoto_Scenery"), - &gyoto_Scenery_free, &gyoto_Scenery_print, &gyoto_Scenery_eval, - 0, 0 - }; + // Call worker on the parent thread + (*ySceneryThreadWorker)(static_cast(&larg)); - int _yarg_Scenery(int iarg) { - return yget_obj(iarg, 0)==gyoto_Scenery_obj.type_name; - } - - void * _ypush_Scenery() { - return ypush_obj(&gyoto_Scenery_obj, sizeof(gyoto_Scenery)); - } - - void * _yget_Scenery(int iarg) { - return yget_obj(iarg, &gyoto_Scenery_obj); +# ifdef HAVE_PTHREAD + // Wait for the child threads + if (nthreads>=2) + for (size_t th=0; th < nthreads-1; ++th) + pthread_join(threads[th], NULL); +# endif + if (impactcoords==NULL) GYOTO_MSG << endl; + } + } } // Constructor - void Y_gyoto_Scenery(int n) { - void* obj = NULL; - if (_yarg_Scenery(n-1)) obj = _yget_Scenery(--n); - gyoto_Scenery_eval(obj, n); + void Y_gyoto_Scenery(int argc) { + YGYOTO_CONSTRUCTOR_INIT1(Scenery, Scenery, Scenery); + gyoto_Scenery_eval(OBJ, argc); } void Y_gyoto_Scenery_rayTrace(int argc) { - size_t imin=0, imax=-1, jmin=0, jmax=-1; + size_t imin=1, imax=-1, jmin=1, jmax=-1; if (argc<1) y_error("gyoto_Scenery_rayTrace takes at least 1 argument"); gyoto_Scenery * s_obj=(gyoto_Scenery*)yget_obj(argc-1, &gyoto_Scenery_obj); + Scenery * scenery = s_obj->smptr; if (argc>=2 && !yarg_nil(argc-2)) imin=ygets_l(argc-2); if (argc>=3 && !yarg_nil(argc-3)) imax=ygets_l(argc-3); if (argc>=4 && !yarg_nil(argc-4)) jmin=ygets_l(argc-4); if (argc>=5 && !yarg_nil(argc-5)) jmax=ygets_l(argc-5); size_t res; - try {res=s_obj->scenery->getScreen()->getResolution();} + try {res=scenery->getScreen()->getResolution();} YGYOTO_STD_CATCH; - long dims[4]={3, res, res, 2}; - double * data=ypush_d(dims); - Astrobj::Properties prop(data,data+res*res); + double * impactcoords = NULL; + int ipctout = 0; + if (argc>=6) { + int iarg = argc-6; + long ref = yget_ref(iarg); + long dims[Y_DIMSIZE] = {3, 16, res, res}; + if (ref >= 0 && yarg_nil(iarg)) { + impactcoords = ypush_d(dims); + yput_global(ref, 0); + ipctout = 1; + } else { + long ntot = 0; + impactcoords = ygeta_d(iarg, &ntot, dims); + if (dims[0]!=3 || dims[1]!=16 || dims[2]!=res || dims[3]!=res) + y_error("Wrong dims for impactcoords"); + } + } - try {s_obj->scenery -> rayTrace(imin, imax, jmin, jmax, &prop);} - YGYOTO_STD_CATCH; + size_t nbnuobs=0, nbdata; + Quantity_t quantities; + try { + quantities = scenery -> getRequestedQuantities(); + if (quantities & (GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_BINSPECTRUM)) { + SmartPointer spr=scenery->getScreen()->getSpectrometer(); + if (!spr) throwError("Spectral quantity requested but " + "no spectrometer specified!"); + nbnuobs = spr -> getNSamples(); + } + nbdata= scenery->getScalarQuantitiesCount(); + } YGYOTO_STD_CATCH; - } + long dims[4]={(nbdata+nbnuobs) > 1 ? 3 : 2, res, res, nbdata+nbnuobs}; + double * vect=ypush_d(dims); -} -// PUBLIC API + Astrobj::Properties data; -SmartPointer *yget_Scenery(int iarg) { - return &((gyoto_Scenery*)yget_obj(iarg, &gyoto_Scenery_obj))->scenery; -} -SmartPointer *ypush_Scenery() { - gyoto_Scenery* obj = (gyoto_Scenery*)ypush_obj(&gyoto_Scenery_obj, sizeof(gyoto_Scenery)); - return &(obj->scenery); -} + size_t curquant=0; + size_t offset=res*res; + + if (ipctout) data.impactcoords = impactcoords; + + if (quantities & GYOTO_QUANTITY_INTENSITY) + data.intensity=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_EMISSIONTIME) + data.time=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_MIN_DISTANCE) + data.distance=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_FIRST_DMIN) + data.first_dmin=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_REDSHIFT) + data.redshift=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_USER1) + data.user1=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_USER2) + data.user2=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_USER3) + data.user3=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_USER4) + data.user4=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_USER5) + data.user5=vect+offset*(curquant++); + if (quantities & GYOTO_QUANTITY_SPECTRUM) { + data.spectrum=vect+offset*(curquant++); + data.offset=offset; + } + if (quantities & GYOTO_QUANTITY_BINSPECTRUM) { + data.binspectrum=vect+offset*(curquant++); + data.offset=offset; + } + + data.intensity=vect; + + try {scenery -> rayTrace(imin, imax, jmin, jmax, &data, + ipctout?NULL:impactcoords);} + YGYOTO_STD_CATCH; + + } -int yarg_Scenery(int iarg) { - return yget_obj(iarg,0)==gyoto_Scenery_obj.type_name; } diff -Nru gyoto-0.0.3/yorick/gyoto_Scenery.i gyoto-0.1.0/yorick/gyoto_Scenery.i --- gyoto-0.0.3/yorick/gyoto_Scenery.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Scenery.i 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -plug_in, "gyoto"; -/* - Copyright 2011 Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - - -//////// SCENERY - -extern gyoto_Scenery; -/* DOCUMENT scenery = gyoto_Scenery([filename,] [members=values ...]) - Create GYOTO Scenery object - or scenery, [members=values] - Set GYOTO Scenery member - or res = scenery(member=) - Get GYOTO Scenery member - or scenery, xmlwrite=filename - Save Scenery description to XML - or data = scenery([ irange, jrange [, quantities ]]) - Ray-trace scenery - - PURPOSE: - Create and use GYOTO Scenery objects. - - A GYOTO Scenery is used to render an image by relativistic - ray-tracing. A GYOTO Scenery contains references to: - - a GYOTO Metric ("the stage"); - - a GYOTO Astrobj ("the actors"); - - a GYOTO Screen ("the camera"). - - See GYOTO for basic concepts and syntax. - - - MEMBERS: - - metric= see gyoto_Metric(): what "straight" means for light - travel; - - screen= see gyoto_Screen(), it specifies where the obseerver is - located and the obseerving time; - - astrobj= see gyoto_Astrobj(): where the light comes from; - - delta= a double scalar, the initial integration step for the - Photons laucnched during ray-tracing; - - quantities= an array of strings giving the names of physical - quantities that should be retrieved during - ray-tracing. Beware that not all Astrobj kinds support - all of those quantities. The order in which the - quantities are listed when setting this member is not - relevant, the following are equivalent: - data = scenery(quantities=["EmissionTime", "Intensity"])(); - and - data = scenery(quantities=["Intensity", "EmissionTime"])(); - Setting quantities here is not mandatory as the third - positional argument used for ray-tracing permits to - override it in an ordered fashion. - - Recognized quantities: - "Intensity": apparent intensity of the Astrobj; - "EmissionTime": time at which each photonreaching the - screen was emitted; - "MinDistance": minimum distance ever reached between - each photon (whether comingfrom the object or not) - and the Astrobj); - "FirstDistMin": First local minimum in the - Astrobj/Photon distance; - "Redshift": ; - "ImpactR", "ImpactX", "ImpactY" and "ImpactZ": R - (specrical), X, Y and Z (Cartsesian) coordinates - at which a photon was emitted by the Astrobj; - "Spectrum": Inu spectrum of the Astrobj on this pixel, - the spectrometer is specified in the Screen - object; - "BinSpectrum": spectrum of the Astrobj on this pixel - (the spectrometer is specified in the Screen - object), as would be detected by a real - spectrometer: the value in each spectral channel - is the integral of Inu over the spectral channel; - "User1" to "User5": other specific scalar quantities an - Astrobj may be able to compute, refer to the - documentation for the Astrobj kind of your choice. - - - RAY-TRACING: - - Ray-traced data is retrieved calling the object like a function - with no keyword: - data = scenery (); - or data = scenery (irange, jrange, quant ) - - IRANGE and JRANGE are either scalars (i, j) or ranges in the usual - form min:max:step. QUANT is an array of Yorick strings where each - element selects one quantity to retrieve (see the QUANTITIES - member above). QUANT may be void to use the quantities already set - in the Scenery or the default for the Astrobj. If specifyng QUANT, - DATA will be a MxNxP double array, where P=numberof(QUANT) and - DATA(,,i) will contain the value of the quantity specifeid by - QUANT(i). - - QUANTITIES may also be a scalar to retrieve a single - quantity. - - The "Spectrum" quantity is a bit peculiar since it take more than - one plane in data. - - SEE ALSO: - gyoto_Metric, gyoto_Screen, gyoto_Astrobj, gyoto_Photon, - gyoto_Spectrometer -*/ - -extern gyoto_Scenery_rayTrace -/* DOCUMENT res = gyoto_Scenery_rayTrace(scenery, imin, imax, jmin, jmax) - */ - -func _gyoto_Scenery_adaptive_raytrace(sco, respmax, &computed) { -/* xDOCUMENT data = gyoto_Scenery_adaptive_raytrace(scenery, pmax, [computed]) - -BROKEN - - Ray-trace a GYOTO Scenery on an adaptive grid. - - For certain kinds of objects (in particular, Stars), this routine - is much faster than the equivalent: - data = scenery(resolution=3^pmax, raytrace=1); - It is NOT guaranteed that the two methods yield the same result. - - The minimum distance between photon and object is first computed - on a coarse grid which is then refined as required. - - SEE ALSO: gyoto_Scenery - */ - write, format="%s\n", - "WARNING: gyoto_Scenery_adaptive_raytrace() is under development"; - - sc = sco(clone=); // don't modify calling object - - DBL_MAX=1e100; - - screen = sc(screen=); - - respmax=long(respmax); - - resp=1; - resmax=3^respmax; - step=long(3^(respmax-resp)); - first=step/2+1; - - data=array(double, resmax, resmax, 6); - - quantities = ["Intensity", "EmissionTime", "MinDistance", "ImpactX", "ImpactY", "ImpactZ"]; - - screen, resolution=resmax; - data(first::step, first::step, ) = - sc(first::step, first::step, quantities); - - computed=array(long,resmax,resmax); - - nb=9; - for (resp=2, res=3; resp<=respmax; ++resp) { - - // largest distance to neighbour - dsub=data(first::step, first::step,); - ind=where(dsub>=DBL_MAX); - if (numberof(ind)) dsub(ind)=DBL_MAX; - delta = array(double, res, res); - d1=(dsub(dif,,4:6)^2)(,,sum); - d2=(dsub(,dif,4:6)^2)(,,sum); - delta(2:-1,2:-1)=[d1(:-1,2:-1), d1(2:,2:-1), d2(2:-1,:-1), d2(2:-1,2:)](,,max); - delta(1,2:-1)=[d1(1,2:-1), d2(1,:-1), d2(1,2:)](,max); - delta(0,2:-1)=[d1(0,2:-1), d2(0,:-1), d2(0,2:)](,max); - delta(2:-1,1)=[d2(2:-1,1), d1(:-1,1), d1(2:,1)](,max); - delta(2:-1,0)=[d2(2:-1,0), d1(:-1,0), d1(2:,0)](,max); - delta(0,0)=[d1(0,0), d2(0,0)](max); - delta(1,1)=[d1(1,1), d2(1,1)](max); - delta(0,1)=[d1(0,1), d2(0,1)](max); - delta(1,0)=[d1(1,0), d2(1,0)](max); - - - // ! BEWARE : res is updated here - res*=3; - refine=array(int, res, res); - refine(1::3, 1::3) = - refine(2::3, 1::3) = - refine(3::3, 1::3) = - refine(1::3, 2::3) = - refine(2::3, 2::3) = - refine(3::3, 2::3) = - refine(1::3, 3::3) = - refine(2::3, 3::3) = - refine(3::3, 3::3) = - (dsub(,,3)<4*delta) | (dsub(,,3)<2); - - nstep=long(3^(respmax-resp)); - nfirst=first-nstep; - data(nfirst ::step,nfirst ::step,)= - data(first ::step,nfirst ::step,)= - data(first+nstep::step,nfirst ::step,)= - data(nfirst ::step,first ::step,)= - data(first+nstep::step,first ::step,)= - data(nfirst ::step,first+nstep::step,)= - data(first ::step,first+nstep::step,)= - data(first+nstep::step,first+nstep::step,)= - dsub; - - step=nstep; - first=nfirst; - for (i=1; i<=res; ++i) { - ibis=(i-1)*step+first; - ind=where(refine(i,) & !computed(ibis,first::step)); - nb+=numberof(ind); - if (numberof(ind)) { - indbis=(ind-1)*step+first; - data(ibis,indbis,)=sc(ibis, indbis, quantities); - computed(ibis, indbis)=resp; - } - } - - } - nb; - return data; -} diff -Nru gyoto-0.0.3/yorick/gyoto_Screen.C gyoto-0.1.0/yorick/gyoto_Screen.C --- gyoto-0.0.3/yorick/gyoto_Screen.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Screen.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -26,179 +26,40 @@ #include using namespace std; - - using namespace Gyoto; -extern "C" { - typedef struct gyoto_Screen { SmartPointer screen; } gyoto_Screen; - void gyoto_Screen_free(void *obj); - void gyoto_Screen_print(void *obj); - void gyoto_Screen_eval(void *obj, int n); - static y_userobj_t gyoto_Screen_obj = - {const_cast("gyoto_Screen"), &gyoto_Screen_free, &gyoto_Screen_print, &gyoto_Screen_eval, 0, 0}; - - // SCREEN CLASS - void gyoto_Screen_free(void *obj) { - if (((gyoto_Screen*)obj)->screen) { - ((gyoto_Screen*)obj)->screen=NULL; - } else printf("null pointer\n"); - } - - void gyoto_Screen_print(void *obj) { -#ifdef GYOTO_USE_XERCES - string rest="", sub=""; - try { rest = Factory(((gyoto_Screen*)obj)->screen).format(); } - YGYOTO_STD_CATCH; - size_t pos=0, len; - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); - } -#else - y_print("GYOTO screen ",0); - // SmartPointer gg = ((gyoto_Screen*)obj)->screen; - // y_print(gg->getKind().c_str(),0); -#endif - } +YGYOTO_YUSEROBJ(Screen, Screen) +extern "C" { void gyoto_Screen_eval(void *obj, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - - SmartPointer *screen = NULL; //&((gyoto_Screen*)obj)->screen; - - if (!obj) { - obj = ypush_obj(&gyoto_Screen_obj, sizeof(gyoto_Screen)); - screen = &(((gyoto_Screen*)obj)->screen); - *screen = new Screen(); - } else if (argc==1 && yarg_nil(0)) { // If no parameters, return pointer - ypush_long( (long) ((gyoto_Screen*)obj)->screen() ); - return; - } else { - screen = &(((gyoto_Screen*)obj)->screen); - *ypush_Screen()=*screen; - } - + SmartPointer *OBJ_ = &((gyoto_Screen*)obj)->smptr; static char const * knames[]={ + "unit", "metric", "time","fov","resolution", "distance", "dmax", "inclination", "paln", "argument", + "freqobs", "projection", "observerpos", + "fourvel", "screen1", "screen2", "screen3", "spectro", "skycoord", "raycoord", "xmlwrite", "clone", 0 }; -#define nkw 16 - static long kglobs[nkw+1]; - int kiargs[nkw]; - int piargs[]={-1,-1,-1,-1}; - // push default return value: need to drop before pushing another one - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Metric takes at most 4 positional arguments"); - } - } - - /* METRIC */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error("Only one return value possible"); - *ypush_Metric() = (*screen)->getMetric(); - } else // set - (*screen)->setMetric(*yget_Metric(kiargs[k])); - } - - /* OBSERVING TIME */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error("Only one return value possible"); - ypush_double((*screen)->getTime()); - } else - (*screen) -> setTime(ygets_d(iarg)); - } - - /* FIELD OF VIEW (fov) */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error("Only one return value possible"); - ypush_double((*screen)->getFieldOfView()); - } else - (*screen) -> setFieldOfView(ygets_d(iarg)); - } - - /* RESOLUTION */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error("Only one return value possible"); - ypush_long((*screen)->getResolution()); - } else - (*screen) -> setResolution (ygets_l(iarg)); - } - - /* DISTANCE */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error(rmsg); - ypush_double((*screen)->getDistance()); - } else - (*screen) -> setDistance (ygets_d(iarg)) ; - } - - /* DMAX */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error(rmsg); - ypush_double((*screen)->getDmax()); - } else - (*screen) -> setDmax (ygets_d(iarg)) ; - } - - /* INCLINAITION */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error(rmsg); - ypush_double((*screen)->getInclination()); - } else - (*screen) -> setInclination (ygets_d(iarg)) ; - } + YGYOTO_WORKER_INIT1(Screen, Screen, knames, 22) - /* POSITION ANGLE OF THE LINE OF NODES (paln) */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error(rmsg); - ypush_double((*screen)->getPALN()); - } else - (*screen) -> setPALN (ygets_d(iarg)) ; - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_OBJECT(Metric); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Time); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(FieldOfView); + YGYOTO_WORKER_GETSET_LONG(Resolution); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Distance); + YGYOTO_WORKER_GETSET_DOUBLE(Dmax); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Inclination); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(PALN); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Argument); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(FreqObs); - /* ARGUMENT */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get - if ((*rvset)++) y_error(rmsg); - ypush_double((*screen)->getArgument()); - } else - (*screen) -> setArgument (ygets_d(iarg)) ; - } - /* PROJECTION */ if ((iarg=kiargs[++k])>=0) { // Set Projection iarg+=*rvset; @@ -206,41 +67,20 @@ double *proj=ygeta_d(iarg, &ntot, NULL); switch (ntot) { case 4: - (*screen)->setProjection(proj[0], proj[1], proj[2], proj[3]); + (*OBJ)->setProjection(proj[0], proj[1], proj[2], proj[3]); break; case 3: - (*screen)->setProjection(proj[0], proj[1], proj[2]); + (*OBJ)->setProjection(proj[0], proj[1], proj[2]); break; } } - /* OBSERVERPOS */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get_observerpos - if ((*rvset)++) y_error(rmsg); - long dims[] = {1,4}; - double * coord=ypush_d(dims); - (*screen)->getObserverPos(coord); - } else { // Set ObserverPos - long ntot; - double * pos = ygeta_d(iarg, &ntot, NULL); - if (ntot<4) y_error("POS must have at least 4 elements"); - (*screen) -> setObserverPos(pos); - } - } - - /* SPECTRO */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - *ypush_Spectrometer() = (*screen) -> getSpectrometer(); - } else { - (*screen) -> setSpectrometer(*yget_Spectrometer(iarg)); - } - } - + YGYOTO_WORKER_GETSET4(ObserverPos); + YGYOTO_WORKER_GETSET4(FourVel); + YGYOTO_WORKER_GETSET4(Screen1); + YGYOTO_WORKER_GETSET4(Screen2); + YGYOTO_WORKER_GETSET4(Screen3); + YGYOTO_WORKER_GETSET_OBJECT(Spectrometer); ///// METHODS ////// /* SKYCOORD METHOD */ @@ -253,7 +93,7 @@ long dims[] = {1, 3}; double * skypos=ypush_d(dims); - (*screen)->coordToXYZ(pos, skypos); + (*OBJ)->coordToXYZ(pos, skypos); } /* RAYCOORD METHOD */ @@ -268,51 +108,20 @@ yarg_drop(1); double * coord=ypush_d(dims); - (*screen)->getRayCoord(pos[0], pos[1], coord); + (*OBJ)->getRayCoord(pos[0], pos[1], coord); } - // Save to file - if ((iarg=kiargs[++k])>=0) { // xmlwrite - iarg+=*rvset; -#ifdef GYOTO_USE_XERCES - char *filename=ygets_q(kiargs[k]); - Factory((*screen)).write(filename); -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } + YGYOTO_WORKER_XMLWRITE; + YGYOTO_WORKER_CLONE(Screen); - /* CLONE */ - if ((iarg=kiargs[++k])>=0) { - if ((*rvset)++) y_error(rmsg); - *ypush_Screen() = (*screen)->clone(); - } } } -// PUBLIC API - -SmartPointer *yget_Screen(int iarg) { - return &((gyoto_Screen*)yget_obj(iarg, &gyoto_Screen_obj))->screen; -} -SmartPointer *ypush_Screen() { - gyoto_Screen* obj = (gyoto_Screen*)ypush_obj(&gyoto_Screen_obj, sizeof(gyoto_Screen)); - return &(obj->screen); -} - -int yarg_Screen(int iarg) { - return yget_obj(iarg,0)==gyoto_Screen_obj.type_name; -} - - -// YAPI FUNCTIONS - extern "C" { void Y_gyoto_Screen(int argc) { - void *obj = NULL; - if (yarg_Screen(argc)) obj = yget_obj(--argc, &gyoto_Screen_obj) ; - gyoto_Screen_eval(obj, argc); + YGYOTO_CONSTRUCTOR_INIT1(Screen, Screen, Screen); + gyoto_Screen_eval(OBJ, argc); } diff -Nru gyoto-0.0.3/yorick/gyoto_SpectroComplex.C gyoto-0.1.0/yorick/gyoto_SpectroComplex.C --- gyoto-0.0.3/yorick/gyoto_SpectroComplex.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_SpectroComplex.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,94 @@ +/* + Copyright 2013 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include +#include +#include "ygyoto.h" +#include "yapi.h" + +#include +using namespace std; + +using namespace Gyoto; +using namespace Gyoto::Spectrometer; + +namespace YGyoto { + ygyoto_Spectrometer_eval_worker_t SpCplxEval; +} + +// on_eval worker +void YGyoto::SpCplxEval(SmartPointer *OBJ_, int argc) { + static char const * knames[]={ + "unit", + "append", "remove", "cardinal", \ + YGYOTO_SPECTROMETER_GENERIC_KW, + 0 + }; + + YGYOTO_WORKER_INIT(Spectrometer, Complex, + knames, YGYOTO_SPECTROMETER_GENERIC_KW_N+4); + + YGYOTO_WORKER_SET_UNIT; + + YGYOTO_WORKER_RUN( append(*yget_Spectrometer(iarg)) ); + YGYOTO_WORKER_RUN( remove(ygets_l(iarg)) ); + + /* cardinal */ + if ((iarg=kiargs[++k])>=0) { + iarg+=*rvset; + if ((*rvset)++) y_error(rmsg); + GYOTO_DEBUG << "get cardinal" << endl; + ypush_long((*OBJ)->getCardinal()); + } + + YGYOTO_WORKER_CALL_GENERIC(Spectrometer); + + if (!(*paUsed) && (iarg=piargs[0])>=0 && !yarg_nil(iarg)) { + iarg+=*rvset; + if ((*rvset)++) y_error(rmsg); + ++(*paUsed); + size_t cardinal=(*OBJ) -> getCardinal(); + long item = ygets_l(iarg); + if (item > cardinal) y_error("index overreach array bounds"); + if (item <= 0) { + item += cardinal; + if (item <= 0) y_error("index overreach array bounds"); + } + *ypush_Spectrometer() = (*(*OBJ))[item-1]; + } + + GYOTO_DEBUG << "done\n"; +} + + +extern "C" { + void Y__gyoto_SpCplx_register_as_Spectrometer(int argc){ + ygyoto_Spectrometer_register(Complex::Kind,&YGyoto::SpCplxEval); + } + + void + Y_gyoto_SpectroComplex(int argc) + { + YGYOTO_CONSTRUCTOR_INIT(Spectrometer, Complex); + if ((*OBJ)->getKind() != Complex::Kind) + y_error("Expecting Spectrometer of kind Complex"); + YGyoto::SpCplxEval(OBJ, argc); + } + +} diff -Nru gyoto-0.0.3/yorick/gyoto_SpectroUniform.C gyoto-0.1.0/yorick/gyoto_SpectroUniform.C --- gyoto-0.0.3/yorick/gyoto_SpectroUniform.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_SpectroUniform.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,171 @@ +/* + Copyright 2011-2013 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include +#include "ygyoto.h" +#include "GyotoUniformSpectrometer.h" +#include "yapi.h" +#include "pstdlib.h" +#ifdef GYOTO_USE_XERCES +#include "GyotoFactory.h" +#endif +using namespace std; +using namespace Gyoto; +using namespace Gyoto::Spectrometer; + +#define OBJ sp + +namespace YGyoto { + void SpectroUniformYEval(SmartPointer*sp, int argc); +} +using namespace YGyoto; + +void +YGyoto::SpectroUniformYEval(Gyoto::SmartPointer*sp_, + int argc) +{ + + static char const * knames[]={ + "unit", + "kind", "nsamples", "band", + "setparameter", + "xmlwrite", "clone", + "channels", "midpoints", "widths", + 0 + }; + YGYOTO_WORKER_INIT(Spectrometer, Uniform, + knames, 10); + + YGYOTO_WORKER_SET_UNIT; + + /* SPECTRO_KIND */ + if ((iarg=kiargs[++k])>=0) { + iarg+=*rvset; + if (yarg_nil(iarg)) { // get spectro kind + if ((*rvset)++) y_error(rmsg); + *ypush_q(0) = p_strcpy((*sp) -> getKind() ); + } else { // set spectro kind + (*sp) -> setKind(std::string(ygets_q(iarg))); + } + } + + YGYOTO_WORKER_GETSET_LONG(NSamples); + + /* BAND */ + if ((iarg=kiargs[++k])>=0) { + iarg+=*rvset; + double * boundaries = NULL; + if (yarg_nil(iarg)) { // get spectro band + if ((*rvset)++) y_error(rmsg); + long dims[Y_DIMSIZE] = {1, 2}; + boundaries=ypush_d(dims); + boundaries[0] = (*sp) -> getBand()[0]; + boundaries[1] = (*sp) -> getBand()[1]; + } else { // set spectro band + long ntot; + boundaries = ygeta_d(iarg, &ntot, NULL); + if (ntot != 2) + y_error("BAND must have 2 elements"); + (*sp) -> setBand(boundaries, unit?unit:""); + } + } + + YGYOTO_WORKER_SETPARAMETER; +#undef OBJ +#define OBJ sp_ + YGYOTO_WORKER_XMLWRITE; +#undef OBJ +#define OBJ sp + YGYOTO_WORKER_CLONE(Spectrometer); + + /* GET SPECTRO CHANNELS */ + if ((iarg=kiargs[++k])>=0) { + if (!yarg_nil(iarg)) y_error("CHANNELS is readonly"); + if ((*rvset)++) y_error(rmsg); + size_t nsamples = (*sp) -> getNSamples(); + if (nsamples) { + long dims[] = {2, 2, nsamples}; + double converted[(*sp)->getNBoundaries()]; + (*sp) -> getChannelBoundaries(converted, unit?unit:""); + GYOTO_DEBUG_ARRAY(converted, (*sp)->getNBoundaries()); + size_t const * const chanind = (*sp) -> getChannelIndices(); + GYOTO_DEBUG_ARRAY(chanind, 2*nsamples); + double * ychannels = ypush_d(dims); + for (size_t i=0; i<2*nsamples; ++i) { + ychannels[i] = converted[chanind[i]]; + GYOTO_DEBUG << "ychannels["<< i << "]=" << ychannels[i] << endl; + } + + } else ypush_nil(); + } + + /* GET SPECTRO MIDPOINTS */ + if ((iarg=kiargs[++k])>=0) { + if (!yarg_nil(iarg)) y_error("MIDPOINTS is readonly"); + if ((*rvset)++) y_error(rmsg); + size_t nsamples = (*sp) -> getNSamples(); + if (nsamples) { + long dims[] = {1, nsamples}; + double * ychannels = ypush_d(dims); + (*sp)->getMidpoints(ychannels, unit?unit:""); + } else ypush_nil(); + } + + /* GET SPECTRO WIDTHS */ + if ((iarg=kiargs[++k])>=0) { + if (!yarg_nil(iarg)) y_error("WIDTHS is readonly"); + if ((*rvset)++) y_error(rmsg); + size_t nsamples = (*sp) -> getNSamples(); + if (nsamples) { + long dims[] = {1, nsamples}; + double * ywidths = ypush_d(dims); + (*sp)->getWidths(ywidths, unit?unit:""); + } else ypush_nil(); + } + +} + + +extern "C" { + + void Y__gyoto_SpectroUniform_register_as_Spectro(int argc){ + ygyoto_Spectrometer_register(Uniform::WaveKind, + &YGyoto::SpectroUniformYEval); + ygyoto_Spectrometer_register(Uniform::WaveLogKind, + &YGyoto::SpectroUniformYEval); + ygyoto_Spectrometer_register(Uniform::FreqKind, + &YGyoto::SpectroUniformYEval); + ygyoto_Spectrometer_register(Uniform::FreqLogKind, + &YGyoto::SpectroUniformYEval); + } + + void + Y_gyoto_SpectroUniform(int argc) + { + YGYOTO_CONSTRUCTOR_INIT(Spectrometer, Uniform); + kind_t kind=(*sp)->getKind(); + if (kind != Uniform::WaveKind && + kind != Uniform::WaveLogKind && + kind != Uniform::FreqKind && + kind != Uniform::FreqLogKind) + y_error("Expecting Spectrometer of kind Uniform"); + YGyoto::SpectroUniformYEval(OBJ, argc); + } + +} diff -Nru gyoto-0.0.3/yorick/gyoto_Spectrometer.C gyoto-0.1.0/yorick/gyoto_Spectrometer.C --- gyoto-0.0.3/yorick/gyoto_Spectrometer.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Spectrometer.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011-2013 Thibaut Paumard This file is part of Gyoto. @@ -26,109 +26,121 @@ #endif using namespace std; using namespace Gyoto; +using namespace Gyoto::Spectrometer; -namespace YGyoto { - void SpectroYEval(Gyoto::SmartPointer*sp, int argc); -} -using namespace YGyoto; +static char const * ygyoto_Spectrometer_names[YGYOTO_MAX_REGISTERED] +={0}; +static ygyoto_Spectrometer_eval_worker_t *ygyoto_Spectrometer_evals[YGYOTO_MAX_REGISTERED] +={0}; +static int ygyoto_Spectrometer_count=0; -void YGyoto::SpectroYEval(Gyoto::SmartPointer*sp, int argc) { - int k=-1, rvset[1]={0}, paUsed[1]={0}; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; +YGYOTO_YUSEROBJ(Spectrometer, Spectrometer::Generic) +YGYOTO_BASE_CONSTRUCTOR(Spectrometer) - if (!sp) { - sp = ypush_Spectrometer(); - *sp = new Spectrometer(); - } else { - *ypush_Spectrometer() = *sp; - } +extern "C" { + void gyoto_Spectrometer_eval(void *obj, int argc) { + SmartPointer *OBJ_ = + &(((gyoto_Spectrometer*)obj)->smptr); + // If no parameters, return pointer + if (argc==1 && yarg_nil(0)) { + ypush_long( (long) (*OBJ_)() ); + return; + } - static char const * knames[]={ - "kind", "nsamples", "band", - "xmlwrite", - "channels", "midpoints", "widths", - 0 - }; -#define nkw 7 - static long kglobs[nkw+1]; - int kiargs[nkw]; - int piargs[]={-1,-1,-1,-1}; - yarg_kw_init(const_cast(knames), kglobs, kiargs); - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); + // Try calling kind-specific worker + int n=0; + char const * const kind = (*OBJ_)->getKind(); + + while (n*OBJ, + int *kiargs, int *piargs, + int *rvset, int *paUsed, char * unit) { + int k=-1, iarg=-1; + char const * rmsg="Cannot set return value more than once"; + char const * pmsg="Cannot use positional argument more than once"; + long ntot, dims[Y_DIMSIZE]; + + /* METHODS */ + + // kind if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { // get spectro kind - if ((*rvset)++) y_error(rmsg); - *ypush_q(0) = p_strcpy((*sp) -> getKindStr() . c_str()); - } else { // set spectro kind - (*sp) -> setKind(ygets_q(iarg)); - } + if ((*rvset)++) y_error(rmsg); + if (!yarg_nil(iarg)) y_error("KIND is readonly"); + char ** kind = ypush_q(0); + *kind = p_strcpy((*OBJ)->getKind()); } + // Process SET keywords + // Save to file + YGYOTO_WORKER_XMLWRITE; + + /* CLONE */ + YGYOTO_WORKER_CLONE(Spectrometer); + + // get members // /* NSAMPLES */ if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; - if (yarg_nil(iarg)) ypush_long((*sp)->getNSamples()); - else (*sp) -> setNSamples( ygets_l(iarg) ); + if (yarg_nil(iarg)) ypush_long((*OBJ)->getNSamples()); + else y_error("NSAMPLES is readonly"); } - /* BAND */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - double * boundaries = NULL; - if (yarg_nil(iarg)) { // get spectro band - if ((*rvset)++) y_error(rmsg); - long dims[Y_DIMSIZE] = {1, 2}; - boundaries=ypush_d(dims); - boundaries[0] = (*sp) -> getBand()[0]; - boundaries[1] = (*sp) -> getBand()[1]; - } else { // set spectro band - long ntot; - boundaries = ygeta_d(iarg, &ntot, NULL); - if (ntot != 2) - y_error("BAND must have 2 elements"); - (*sp) -> setBand(boundaries); - } - } - - // Save to file - if ((iarg=kiargs[++k])>=0) { // xmlwrite - iarg+=*rvset; -#ifdef GYOTO_USE_XERCES - char *filename=ygets_q(iarg); - Factory(*sp).write(filename); -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } + /* SETPARAMETER */ + YGYOTO_WORKER_SETPARAMETER; /* GET SPECTRO CHANNELS */ if ((iarg=kiargs[++k])>=0) { + if (!yarg_nil(iarg)) y_error("CHANNELS is readonly"); if ((*rvset)++) y_error(rmsg); - size_t nsamples = (*sp) -> getNSamples(); + size_t nsamples = (*OBJ) -> getNSamples(); if (nsamples) { - long dims[] = {1, nsamples+1}; - double const * const nuchannels = (*sp) -> getChannels(); - SpectroKind_t kind= (*sp) -> getKind(); + long dims[] = {2, 2, nsamples}; + double converted[(*OBJ)->getNBoundaries()]; + (*OBJ) -> getChannelBoundaries(converted, unit?unit:""); + GYOTO_DEBUG_ARRAY(converted, (*OBJ)->getNBoundaries()); + size_t const * const chanind = (*OBJ) -> getChannelIndices(); + GYOTO_DEBUG_ARRAY(chanind, 2*nsamples); double * ychannels = ypush_d(dims); - for (size_t i=0; i<=nsamples; ++i) { - ychannels[i] = nuchannels[i]; - if (kind==GYOTO_SPECTRO_KIND_WAVE || - kind==GYOTO_SPECTRO_KIND_WAVELOG) - ychannels[i]=GYOTO_C/ychannels[i]; - if (kind==GYOTO_SPECTRO_KIND_FREQLOG || - kind==GYOTO_SPECTRO_KIND_WAVELOG) - ychannels[i]=log10(ychannels[i]); + for (size_t i=0; i<2*nsamples; ++i) { + ychannels[i] = converted[chanind[i]]; + GYOTO_DEBUG << "ychannels["<< i << "]=" << ychannels[i] << endl; } } else ypush_nil(); @@ -136,107 +148,27 @@ /* GET SPECTRO MIDPOINTS */ if ((iarg=kiargs[++k])>=0) { + if (!yarg_nil(iarg)) y_error("MIDPOINTS is readonly"); if ((*rvset)++) y_error(rmsg); - size_t nsamples = (*sp) -> getNSamples(); + size_t nsamples = (*OBJ) -> getNSamples(); if (nsamples) { long dims[] = {1, nsamples}; - double const * const nuchannels = (*sp) -> getMidpoints(); - SpectroKind_t kind= (*sp) -> getKind(); double * ychannels = ypush_d(dims); - for (size_t i=0; igetMidpoints(ychannels, unit?unit:""); } else ypush_nil(); } /* GET SPECTRO WIDTHS */ if ((iarg=kiargs[++k])>=0) { + if (!yarg_nil(iarg)) y_error("WIDTHS is readonly"); if ((*rvset)++) y_error(rmsg); - size_t nsamples = (*sp) -> getNSamples(); + size_t nsamples = (*OBJ) -> getNSamples(); if (nsamples) { long dims[] = {1, nsamples}; - double const * const nuwidths = (*sp) -> getWidths(); - SpectroKind_t kind= (*sp) -> getKind(); double * ywidths = ypush_d(dims); - for (size_t i=0; igetWidths(ywidths, unit?unit:""); } else ypush_nil(); } } - -extern "C" { - typedef struct gyoto_Spectro { - SmartPointer spectro; - } gyoto_Spectro; - - - void gyoto_Spectro_free(void *obj) { - if (((gyoto_Spectro*)obj)->spectro) { - ((gyoto_Spectro*)obj)->spectro = NULL; - } else printf("null pointer\n"); - } - - void gyoto_Spectro_print(void *obj) { -#ifdef GYOTO_USE_XERCES - string rest="", sub=""; - size_t pos=0, len=0; - rest = Factory(((gyoto_Spectro*)obj)->spectro).format(); - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); - } -#else - y_print("GYOTO Spectrum object of type ",0); - y_print(((gyoto_Spectro*)obj)->spectro->getKindStr().c_str(),0); -#endif - } - void gyoto_Spectro_eval(void *obj, int argc) { - // If no parameters, return pointer - if (argc==1 && yarg_nil(0)) { - ypush_long((long)((gyoto_Spectro*)obj)->spectro()); - return; - } - SmartPointer * sp = &(((gyoto_Spectro*)obj)->spectro); - YGyoto::SpectroYEval(sp, argc); - } - static y_userobj_t gyoto_Spectro_obj = - {const_cast("gyoto_Spectrometer"), &gyoto_Spectro_free, &gyoto_Spectro_print, - &gyoto_Spectro_eval, 0, 0}; - - void - Y_gyoto_Spectrometer(int argc) - { - if (debug()) cerr << "In Y_gyoto_Spectrometer" << endl; - SmartPointer *sp = NULL; - if (yarg_Spectrometer(argc-1)) { - sp = yget_Spectrometer(--argc); - } - SpectroYEval(sp, argc); - } -} - -int -yarg_Spectrometer(int iarg) { - return yget_obj(iarg,0)==gyoto_Spectro_obj.type_name; -} - -SmartPointer* yget_Spectrometer(int iarg) { - return &(((gyoto_Spectro*)yget_obj(iarg, &gyoto_Spectro_obj))->spectro); -} - -SmartPointer* ypush_Spectrometer() { - return &(((gyoto_Spectro*)(ypush_obj(&gyoto_Spectro_obj, - sizeof(gyoto_Spectro))))->spectro); -} - diff -Nru gyoto-0.0.3/yorick/gyoto_Spectrum.C gyoto-0.1.0/yorick/gyoto_Spectrum.C --- gyoto-0.0.3/yorick/gyoto_Spectrum.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_Spectrum.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -25,6 +25,7 @@ #include #endif +#include using namespace std; using namespace Gyoto; using namespace Gyoto::Spectrum; @@ -35,97 +36,43 @@ ={0}; static int ygyoto_Spectrum_count=0; +YGYOTO_YUSEROBJ(Spectrum, Spectrum::Generic) +YGYOTO_BASE_CONSTRUCTOR(Spectrum) + extern "C" { - // SPECTRUM CLASS - // Opaque Yorick object - typedef struct gyoto_Spectrum { - SmartPointer spectrum; - //char type[YGYOTO_TYPE_LEN]; - } gyoto_Spectrum; - void gyoto_Spectrum_free(void *obj) { - if (((gyoto_Spectrum*)obj)->spectrum) { - ((gyoto_Spectrum*)obj)->spectrum = NULL; - } else printf("null pointer\n"); - } - void gyoto_Spectrum_print(void *obj) { -#ifdef GYOTO_USE_XERCES - string rest="", sub=""; - size_t pos=0, len=0; - rest = Factory(((gyoto_Spectrum*)obj)->spectrum).format(); - while (len=rest.length()) { - sub=rest.substr(0, pos=rest.find_first_of("\n",0)); - rest=rest.substr(pos+1, len-1); - y_print( sub.c_str(),1 ); - } -#else - y_print("GYOTO Spectrum object of type ",0); - y_print(((gyoto_Spectrum*)obj)->spectrum->getKind().c_str(),0); -#endif - } void gyoto_Spectrum_eval(void *obj, int argc) { // If no parameters, return pointer if (argc==1 && yarg_nil(0)) { - ypush_long((long)((gyoto_Spectrum*)obj)->spectrum()); + ypush_long((long)((gyoto_Spectrum*)obj)->smptr()); return; } // Try calling kind-specific worker int n=0; - SmartPointer * sp = &(((gyoto_Spectrum*)obj)->spectrum); - const string kind = (*sp)->getKind(); + SmartPointer * OBJ_ = &(((gyoto_Spectrum*)obj)->smptr); + const string kind = (*OBJ_)->getKind(); while (n(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Spectrum takes at most 4 positional arguments"); - } - } - - int rvset[1]={0}, paUsed[1]={0}; - ygyoto_Spectrum_generic_eval(sp, kiargs, piargs, rvset, paUsed); - + YGYOTO_WORKER_INIT(Spectrum, Generic, + knames, YGYOTO_SPECTRUM_GENERIC_KW_N+1); + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_CALL_GENERIC(Spectrum); } - static y_userobj_t gyoto_Spectrum_obj = - {const_cast("gyoto_Spectrum"), &gyoto_Spectrum_free, &gyoto_Spectrum_print, &gyoto_Spectrum_eval, 0, 0}; - -} - -SmartPointer* yget_Spectrum(int iarg) { - return &(((gyoto_Spectrum*)yget_obj(iarg, &gyoto_Spectrum_obj))->spectrum); -} - -SmartPointer* ypush_Spectrum() { - return &(((gyoto_Spectrum*)(ypush_obj(&gyoto_Spectrum_obj, - sizeof(gyoto_Spectrum))))->spectrum); } -int yarg_Spectrum(int iarg) { - return yget_obj(iarg,0)==gyoto_Spectrum_obj.type_name; -} - - void ygyoto_Spectrum_register(char const*const name, ygyoto_Spectrum_eval_worker_t* on_eval){ int n; if (ygyoto_Spectrum_count==YGYOTO_MAX_REGISTERED) @@ -138,9 +85,9 @@ ygyoto_Spectrum_evals[ygyoto_Spectrum_count++]=on_eval; } -void ygyoto_Spectrum_generic_eval(Gyoto::SmartPointer*sp, +void ygyoto_Spectrum_generic_eval(Gyoto::SmartPointer*OBJ, int *kiargs, int *piargs, - int *rvset, int *paUsed) { + int *rvset, int *paUsed, char* unit) { int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; @@ -150,32 +97,20 @@ cerr << "DEBUG: Spectrum_generic_eval: kiargs[" << i << "]=" << kiargs[i] << endl; - // Save to file - if ((iarg=*(kiargs++))>=0) { // xmlwrite - iarg+=*rvset; -#ifdef GYOTO_USE_XERCES - char *filename=ygets_q(iarg); - Factory(*sp).write(filename); -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } - - // kind - if ((iarg=*(kiargs++))>=0) { + YGYOTO_WORKER_XMLWRITE; + + // kind + if ((iarg=kiargs[++k])>=0) { iarg+=*rvset; if (!yarg_nil(iarg)) y_error("KIND is readonly"); if (debug()) cerr << "kiargs=" << kiargs << endl; if ((*rvset)++) y_error(rmsg); char ** kind = ypush_q(0); - *kind = p_strcpy((*sp)->getKind().c_str()); + *kind = p_strcpy((*OBJ)->getKind().c_str()); } - /* CLONE */ - if ((iarg=kiargs[++k])>=0) { - if ((*rvset)++) y_error(rmsg); - *ypush_Spectrum() = (*sp)->clone(); - } + YGYOTO_WORKER_SETPARAMETER; + YGYOTO_WORKER_CLONE(Spectrum); /* INTEGRATE */ if ((iarg=kiargs[++k])>=0) { @@ -189,7 +124,7 @@ --dims[1]; --ntot; double * Inu1nu2 = ypush_d(dims); for (long i=0; i < ntot; ++i) - Inu1nu2[i] = (*sp)->integrate(freqs[i], freqs[i+1]); + Inu1nu2[i] = (*OBJ)->integrate(freqs[i], freqs[i+1]); } // GET SPECTRUM VALUE FOR WAVELENGTHS @@ -201,65 +136,9 @@ long ntot, dims[Y_DIMSIZE]; double * freqs = ygeta_d(iarg, &ntot, dims); double * Inu = ypush_d(dims); - for (long i=0; i < ntot; ++i) Inu[i] = (**sp)(freqs[i]); + for (long i=0; i < ntot; ++i) Inu[i] = (**OBJ)(freqs[i]); if (debug()) cerr << "DEBUG: out of Spectrum_generic_eval"<< endl; } -extern "C" { - void Y_gyoto_Spectrum(int argc) - { - int rvset[1]={0}, paUsed[1]={0}; - SmartPointer *sp = NULL; - - if (yarg_Spectrum(argc-1)) { - sp = yget_Spectrum(--argc); - *ypush_Spectrum() = *sp; // push back spectrum - } else { // Constructor mode - sp = ypush_Spectrum(); - *rvset=1; - } - - static char const * knames[]={ - YGYOTO_SPECTRUM_GENERIC_KW, - 0 - }; - static long kglobs[YGYOTO_SPECTRUM_GENERIC_KW_N+12]; - int kiargs[YGYOTO_SPECTRUM_GENERIC_KW_N+11]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Spectrum takes at most 4 positional arguments"); - } - } - - // if rvset==1, constructor mode: - if (rvset[1]) { - if (yarg_string(piargs[0])) { -#ifdef GYOTO_USE_XERCES - *sp = Factory(ygets_q(piargs[0])).getSpectrum(); - paUsed[1]=1; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else y_error("Cannot allocate object of virtual class Spectrum"); - } - - ygyoto_Spectrum_generic_eval(sp, kiargs, piargs, rvset, paUsed); - - } - - void - Y_is_gyoto_Spectrum(int argc) - { - ypush_long(yarg_Spectrum(0)); - } - -} diff -Nru gyoto-0.0.3/yorick/gyoto_ThinDisk.C gyoto-0.1.0/yorick/gyoto_ThinDisk.C --- gyoto-0.0.3/yorick/gyoto_ThinDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_ThinDisk.C 2013-07-27 09:14:20.000000000 +0000 @@ -36,11 +36,12 @@ } else *ypush_Astrobj()=*ao_; static char const * knames[]={ + "unit", YGYOTO_THINDISK_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_THINDISK_GENERIC_KW_N+5]; - int kiargs[YGYOTO_THINDISK_GENERIC_KW_N+4]; + static long kglobs[YGYOTO_THINDISK_GENERIC_KW_N+6]; + int kiargs[YGYOTO_THINDISK_GENERIC_KW_N+5]; int piargs[]={-1,-1,-1,-1}; yarg_kw_init(const_cast(knames), kglobs, kiargs); @@ -57,15 +58,25 @@ int k=-1; char const * rmsg="Cannot set return value more than once"; char const * pmsg="Cannot use positional argument more than once"; + + char * unit = NULL; + + /* UNIT */ + if ((iarg=kiargs[++k])>=0) { + iarg+=*rvset; + GYOTO_DEBUG << "get unit" << endl; + unit = ygets_q(iarg); + } + // Call generic ThinDisk worker - ygyoto_ThinDisk_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); + ygyoto_ThinDisk_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed, unit); } void ygyoto_ThinDisk_generic_eval(Gyoto::SmartPointer*ao_, int *kiargs, int *piargs, - int *rvset, int *paUsed) { + int *rvset, int *paUsed, char * unit) { SmartPointer *ao = (SmartPointer *)ao_; int k=-1, iarg; char const * rmsg="Cannot set return value more than once"; @@ -81,9 +92,9 @@ iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getInnerRadius()); + ypush_double((*ao)->getInnerRadius(unit?unit:"")); } else - (*ao)->setInnerRadius(ygets_d(iarg)) ; + (*ao)->setInnerRadius(ygets_d(iarg), unit?unit:"") ; } /* OUTERRADIUS */ @@ -91,9 +102,19 @@ iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getOuterRadius()); + ypush_double((*ao)->getOuterRadius(unit?unit:"")); + } else + (*ao)->setOuterRadius(ygets_d(iarg), unit?unit:"") ; + } + + /* THICKNESS */ + if ((iarg=kiargs[++k])>=0) { + iarg+=*rvset; + if (yarg_nil(iarg)) { + if ((*rvset)++) y_error(rmsg); + ypush_double((*ao)->getThickness(unit?unit:"")); } else - (*ao)->setOuterRadius(ygets_d(iarg)) ; + (*ao)->setThickness(ygets_d(iarg), unit?unit:"") ; } /* DIR */ @@ -106,7 +127,8 @@ (*ao)->setDir(ygets_l(iarg)) ; } - ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); + GYOTO_DEBUG << "calling ygyoto_Astrobj_generic_eval\n"; + ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed, unit); if (debug()) cerr << "DEBUG: out of ThinDisk_generic_eval"<< endl; } diff -Nru gyoto-0.0.3/yorick/gyoto_namespace.i gyoto-0.1.0/yorick/gyoto_namespace.i --- gyoto-0.0.3/yorick/gyoto_namespace.i 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_namespace.i 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,55 @@ +gyoto=save( + haveXerces=gyoto_haveXerces, + loadPlugin=gyoto_loadPlugin, + + Scenery=gyoto_Scenery, + Scenery_rayTrace=gyoto_Scenery_rayTrace, + Photon=gyoto_Photon, + Metric=gyoto_Metric, + Astrobj=gyoto_Astrobj, + ThinDisk=gyoto_ThinDisk, + Screen=gyoto_Screen, + Spectrum=gyoto_Spectrum, + + debug=gyoto_debug, + verbose=gyoto_verbose, + + Spectrometer=gyoto_Spectrometer, + SpectroUniform=gyoto_SpectroUniform, + SpectroComplex=gyoto_SpectroComplex, + + dontcatchSIGFPE=gyoto_dontcatchSIGFPE, + dontcatchSIGSEGV=gyoto_dontcatchSIGSEGV, + listRegister=gyoto_listRegister, + + is_Photon=is_gyoto_Photon, + is_Astrobj=is_gyoto_Astrobj, + is_Metric=is_gyoto_Metric, + is_Spectrometer=is_gyoto_Spectrometer, + is_Spectrum=is_gyoto_Spectrum, + is_Screen=is_gyoto_Screen, + is_Scenery=is_gyoto_Scenery, + + C=GYOTO_C, + G=GYOTO_G, + G_OVER_C_SQUARE=GYOTO_G_OVER_C_SQUARE, + SUN_MASS=GYOTO_SUN_MASS, + SUN_RADIUS=GYOTO_SUN_RADIUS, + KPC=GYOTO_KPC + + ); + +func gyoto_namespace(args) { + /* DOCUMENT gyoto_namespace, shortname=longname; + If this version of yorick supports oxy object, the same as: + save, gyoto, shortname=longname + else, noop. + SEE ALSO: oxy, save, restore + */ + extern gyoto; + keynames=args(-); + for (i=1; i<=numberof(keynames); ++i) { + save, gyoto, keynames(i), args(keynames(i)) ; + } +} +wrap_args, gyoto_namespace; diff -Nru gyoto-0.0.3/yorick/gyoto_utils.C gyoto-0.1.0/yorick/gyoto_utils.C --- gyoto-0.0.3/yorick/gyoto_utils.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyoto_utils.C 2013-07-27 09:14:20.000000000 +0000 @@ -31,6 +31,8 @@ static YGyotoSupplier_t *YGyotoGlobalSupplier = NULL; +void ygyotoErrorHandler (const Gyoto::Error e) { y_error(e); } + extern "C" { void @@ -55,15 +57,71 @@ } void + Y_gyoto_verbose(int argc) + { + ypush_long(Gyoto::verbose()); + if (argc && !yarg_nil(argc)) Gyoto::verbose(ygets_l(1)); + } + + + void + Y_gyoto_loadPlugin(int argc) + { + // Step 1: determine whether nofail is set (to true) + int nofail=0; + static char const * knames[2] = { "nofail", 0 }; + static long kglobs[2]; + int kiargs[1]; + yarg_kw_init(const_cast(knames), kglobs, kiargs); + int iarg=argc-1; + while (iarg>=0) { + iarg = yarg_kw(iarg, kglobs, kiargs); + iarg--; + } + if (kiargs[0]>=0) {// nofail= present + nofail=yarg_true(kiargs[0]); + } + + // Step 2: load plug-ins + long ntot=0; + long dims[Y_DIMSIZE]; + ystring_t * plugins = 0; + for (int iarg=argc-1; iarg>=0; iarg--) { + if (kiargs[0]<0 ||(iarg!=kiargs[0] && iarg!=kiargs[0]+1)) { + plugins = ygeta_q(iarg, &ntot, dims); + for (long i=0; i ypush_Scenery = &ypush_Scenery; YGyotoGlobalSupplier -> yarg_Scenery = &yarg_Scenery; + // Plug Spectrometer ABI + YGyotoGlobalSupplier -> yget_Spectrometer = &yget_Spectrometer; + YGyotoGlobalSupplier -> ypush_Spectrometer = &ypush_Spectrometer; + YGyotoGlobalSupplier -> yarg_Spectrometer = &yarg_Spectrometer; + YGyotoGlobalSupplier -> ygyoto_Spectrometer_register + = &ygyoto_Spectrometer_register; + YGyotoGlobalSupplier -> ygyoto_Spectrometer_generic_eval + = &ygyoto_Spectrometer_generic_eval; } ypush_long(long(YGyotoGlobalSupplier)); } void Y___gyoto_setErrorHandler(int argc) - { Gyoto::setErrorHandler(&y_error); } + { Gyoto::Error::setHandler(&ygyotoErrorHandler); } } diff -Nru gyoto-0.0.3/yorick/gyotoy.glade gyoto-0.1.0/yorick/gyotoy.glade --- gyoto-0.0.3/yorick/gyotoy.glade 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyotoy.glade 1970-01-01 00:00:00.000000000 +0000 @@ -1,879 +0,0 @@ - - - - - - - False - 5 - À propos de Glade - False - center-on-parent - dialog - Gyotoy - pre-alpha - A toy interface to Gyoto - - - True - False - 2 - - - True - False - end - - - False - True - end - 0 - - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - True - - - True - - - True - _Fichier - True - - - True - - - gtk-open - True - True - True - - - - - - gtk-save - True - False - True - True - - - - - - gtk-save-as - True - True - True - - - - - - True - - - - - gtk-quit - True - True - True - - - - - - - - - - True - _Affichage - True - - - True - - - True - Toggle gnomon - True - - - - - - True - Toggle cage - True - - - - - - True - Toggle reticle - True - - - - - - True - Reset 2D limits - True - - - - - - True - Length unit - True - - - True - - - True - Geometrical unit - True - True - - - - - - True - Meter - True - geometrical - - - - - - True - Kilometer - True - geometrical - - - - - - True - Solar radius - True - geometrical - - - - - - True - Arc second - True - geometrical - - - - - - True - Milliarcsecond - True - geometrical - - - - - - True - Microarcsecond - True - geometrical - - - - - - - - - - - - - - True - Aid_e - True - - - True - - - gtk-about - True - True - True - - - - - - - - - - False - 0 - - - - - True - - - True - - - 450 - 471 - True - - - 0 - - - - - - - - 0 - - - - - True - 25 - 2 - - - True - True - Initial integrating step in proper time (geometrical units) - 20 - 20 - 3000 0 10000000000 10 100 0 - 12 - - - - - 1 - 2 - 24 - 25 - - - - - True - Integrate orbit from tâ‚€ to tâ‚ - tâ‚ - - - 24 - 25 - - - - - True - Integration parameters - - - 2 - 23 - 24 - - - - - True - Inclination of equatorial plane (degrees) - Inclination - - - 19 - 20 - - - - - True - Position angle of the line of nodes (degrees) - PALN - - - 18 - 19 - - - - - True - Orbital phase of line of node (degrees) - Phase - - - 20 - 21 - - - - - True - True - Inclination of equatorial plane (degrees) - 20 - 20 - 120 -360 360 1 10 0 - 12 - - - - - 1 - 2 - 19 - 20 - - - - - True - True - Position angle of the line of nodes (degrees) - 20 - 20 - -180 -360 360 1 10 0 - 0.050000000000000003 - 12 - - - - - 1 - 2 - 18 - 19 - - - - - True - True - Orbital phase of line of node (degrees) - 20 - 20 - -120 -360 360 1 10 0 - 12 - - - - - 1 - 2 - 20 - 21 - - - - - True - Projection - - - 2 - 17 - 18 - - - - - True - True - 20 - 20 - 0.016664000000000002 -10 10 0.01 0.10000000000000001 0 - 12 - - - - - 1 - 2 - 15 - 16 - - - - - True - dφ/dt - - - 15 - 16 - - - - - True - True - 20 - 20 - 0 -10 10 0.01 0.10000000000000001 0 - 12 - - - - - 1 - 2 - 14 - 15 - - - - - True - True - 20 - 20 - 0 -10 10 0.01 0.10000000000000001 0 - 12 - - - - - 1 - 2 - 13 - 14 - - - - - True - True - 20 - 20 - 0 -10000 10000 1 10 0 - 12 - - - - - 1 - 2 - 12 - 13 - - - - - True - True - 20 - 20 - 0 -4 4 0.01 0.10000000000000001 0 - 12 - - - - - 1 - 2 - 11 - 12 - - - - - True - True - 20 - 20 - 1.5708 0 4 0.01 0.10000000000000001 0 - 12 - - - - - 1 - 2 - 10 - 11 - - - - - True - True - 20 - 20 - 10.789999999999999 0 1000000 1 10 0 - 12 - - - - - 1 - 2 - 9 - 10 - - - - - True - dθ/dt - 10 - - - 14 - 15 - - - - - True - dr/dt - - - 13 - 14 - - - - - True - tâ‚€ - - - 12 - 13 - - - - - True - φ₀ - - - 11 - 12 - - - - - True - θ₀ - - - 10 - 11 - - - - - True - râ‚€ - - - 9 - 10 - - - - - True - Initial conditions - - - 2 - 8 - 9 - - - - - True - Spin parameter (0 ≤ a < 1) - Spin param. - - - 5 - 6 - - - - - True - True - Spin parameter (0 ≤ a < 1) - 20 - 20 - 0.995 0 0.99999999999900002 0.01 0.10000000000000001 0 - 12 - - - - - 1 - 2 - 5 - 6 - - - - - True - Metric type (only Kerr for now) - Type - 12 - - - 4 - 5 - - - - - True - Metric type (only Kerr for now) - Kerr - - - 1 - 2 - 4 - 5 - - - - - True - Metric parameters - - - 2 - 3 - 4 - - - - - True - - - 2 - 22 - 23 - - - - - True - - - 2 - 16 - 17 - - - - - True - - - 2 - 7 - 8 - - - - - True - Black hole mass (solar masses) - Mass - - - 6 - 7 - - - - - True - True - Black hole mass (solar masses) - 4000000 1 1000000000000 1000 100000 0 - - - - - 1 - 2 - 6 - 7 - - - - - True - Distance from observer (kpc) - Distance - - - 21 - 22 - - - - - True - True - Distance from observer (kpc) - 8 0.01 1000000 1 10 0 - 5 - - - - - 1 - 2 - 21 - 22 - - - - - - 2 - 2 - 3 - - - - - Particle type - True - - - 2 - - - - - True - False - True - - - Star - True - True - False - False - True - True - - - - True - True - 0 - - - - - Photon - True - True - False - False - True - True - star - - - - True - True - 1 - - - - - 2 - 1 - 2 - - - - - True - True - 1 - - - - - True - True - 1 - - - - - - diff -Nru gyoto-0.0.3/yorick/gyotoy.i gyoto-0.1.0/yorick/gyotoy.i --- gyoto-0.0.3/yorick/gyotoy.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/gyotoy.i 2013-07-27 09:14:20.000000000 +0000 @@ -1,7 +1,7 @@ -#!/usr/local/bin/yorick -i +#!/usr/bin/env yorick -i /* Copyright 2007 F. Rigaut - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -25,34 +25,46 @@ syntax: yorick -i gyotoy.i */ -require,"pyk.i"; require, "gyoto.i"; require, "gyoto_std.i"; require, "pl3d.i"; +// gy_gtk needs to be included after defining gy_gtk_before_init +// require, "gy_gtk.i"; + +func __gyotoy_before_init +{ + noop, gy.GLib.set_prgname("Gyotoy"); + noop, gy.GLib.set_application_name("Gyotoy"); +} + +GYOTOY_VERSION = "0.2"; extern _gyotoy_running; extern _gyotoy_reticle; -extern _gyotoy_wid; extern _gyotoy_wstyle; -extern _gyotoy_filename; extern _gyotoy_stand_alone; extern _gyotoy_particle_is_massless; extern _gyotoy_metric; extern _gyotoy_particle; extern _gyotoy_t1; +extern _gyotoy_delta; +extern _gyotoy_adaptive; extern _gyotoy_initcoord; extern _gyotoy_mass; extern _gyotoy_distance; extern _gyotoy_unit; extern _gyotoy_txyz; extern _gyotoy_particle_to_load; +extern _gyotoy_inhibit_redraw; +extern _gyotoy_metric_file; +extern _gyotoy_nsteps; /* DOCUMENT extern _gyotoy_*; Some variable holding state information for use inside gyotoy. _running: true if GTK interface is running; _reticle: true if reticle should be displayed; - _wid: Yorick window ID of the Gyotoy plot area; + .yid: Yorick window ID of the Gyotoy plot area; _wstyle: window style (normally "nobox.gs"); - _gyotoy_filename: name of the last file read (careful: can be + _gyotoy.filename: name of the last file read (careful: can be the py file itself) _gyotoy_stand_alone: true if the user is not supposed to ever see the Yorick prompt. @@ -60,17 +72,25 @@ _gyoto_metric: the actual metric object. SEE ALSO: gyotoy */ +if (is_void(_gyotoy_nsteps)) _gyotoy_nsteps=100 ; + +func gyotoy_adaptive(mode, void) { + extern _gyotoy_adaptive; + if (!is_numerical(mode)) mode = !mode.get_active(); + _gyotoy_adaptive=mode; + if (mode) _gyotoy_particle, setparameter="Adaptive"; + else _gyotoy_particle, setparameter="NonAdaptive"; +} func gyotoy_reset(void){ extern _gyotoy_running; extern _gyotoy_reticle; - extern _gyotoy_wid; extern _gyotoy_wstyle; - extern _gyotoy_filename; extern _gyotoy_stand_alone; extern _gyotoy_particle_is_massless; extern _gyotoy_metric; extern _gyotoy_particle; + extern _gyotoy_t0; extern _gyotoy_t1; extern _gyotoy_initcoord; extern _gyotoy_mass; @@ -83,10 +103,14 @@ _gyotoy_metric=gyoto_KerrBL(spin=0.995); _gyotoy_initcoord=[0.,10.791,pi/2,0.,0.,0.,0.016664]; _gyotoy_t1=3000.; + _gyotoy_t0=0.; + _gyotoy_delta=0.01; _gyotoy_particle=gyoto_Star(metric=_gyotoy_metric, initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7), - xfill=_gyotoy_t1); + delta=_gyotoy_delta); + gyotoy_adaptive,1; + _gyotoy_particle, xfill=_gyotoy_t1; _gyotoy_txyz=_gyotoy_particle(get_txyz=1); _gyotoy_mass=4e6; _gyotoy_distance=8.; @@ -94,48 +118,93 @@ } gyotoy_reset; -func gyotoy_set_unit(unit) { +func gyotoy_set_unit(unit, data) { extern _gyotoy_unit; + if (!is_string(unit)) { + if (!unit.get_active()) return; + unit=gy.Gtk.Buildable(unit).get_name(); + } _gyotoy_unit=unit; gyotoy_redraw; } -func gyotoy_set_t1(t1) { +func gyotoy_set_t1(t1, void) +{ extern _gyotoy_txyz, _gyotoy_t1; + if (!is_numerical(t1)) t1 = t1.get_value(); + /* if ( (_gyotoy_t1 > _gyotoy_t0 && t1<_gyotoy_t1) || + (_gyotoy_t1 < _gyotoy_t0 && t1>_gyotoy_t1) ) + _gyotoy_particle, reset=;*/ _gyotoy_t1=t1; if (catch(0x08)) return; // avoid breaking in case of v>c - _gyotoy_txyz=_gyotoy_particle(xfill=t1, get_txyz=1); - gyotoy_redraw; + // _gyotoy_txyz=_gyotoy_particle(xfill=t1, get_txyz=1); + gyotoy_compute_and_draw; } -func gyotoy_set_distance(dist) { +func gyotoy_set_distance(dist, void) { extern _gyotoy_distance; + if (!is_numerical(dist)) dist = dist.get_value(); _gyotoy_distance=dist; gyotoy_redraw; } -func gyotoy_set_KerrBL_metric( spin ) { +func gyotoy_set_KerrBL_metric(spin, void) +{ extern _gyotoy_metric, _gyotoy_particle, _gyotoy_txyz; + if (!is_numerical(spin)) spin = spin.get_value(); + _gyotoy_metric = gyoto_KerrBL ( spin = spin ); - if (catch(0x08)) return; // avoid breaking in case of v>c - _gyotoy_txyz=_gyotoy_particle(metric=_gyotoy_metric, - initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7), - xfill=_gyotoy_t1, - get_txyz=1); - gyotoy_redraw; + if (_gyotoy_inhibit_redraw) return; + //if (catch(0x08)) return; // avoid breaking in case of v>c + _gyotoy_particle,metric=_gyotoy_metric, + initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7); + gyotoy_compute_and_draw; +} + +func gyotoy_set_metric(fname, void) +{ + extern _gyotoy_metric, _gyotoy_particle, _gyotoy_txyz, _gyotoy_metric_file; + + if (catch(0x08)) { + // avoid breaking in case bad file + gyotoy_warning, "Unable to load metric. Is this a GYOTO XML description file?"; + return; + } + if (is_void(structof(fname))) + fname = gy.Gtk.FileChooser(fname).get_filename(); + if (is_string(fname)) metric=gyoto_Metric(fname); + if (typeof(metric)!="gyoto_Metric") gyotoy_warning, "Failed to set metric"; + _gyotoy_metric=metric; + _gyotoy_metric_file=fname; + if (catch(0x08)) { + // avoid breaking in case of v>c or other problem + gyotoy_warning, "metric loaded but orbit computation failed"; + return; + } + _gyotoy_particle,metric=_gyotoy_metric, + initcoord=_gyotoy_initcoord(1:4), _gyotoy_initcoord(5:7); + gyotoy_compute_and_draw; } func gyotoy_set_initcoord(t0, r0, theta0, phi0, rprime0, thetaprime0, phiprime0) { - extern _gyotoy_initcoord, _gyotoy_txyz; + extern _gyotoy_initcoord, _gyotoy_txyz, _gyotoy_inhibit_redraw; + if (!is_numerical(t0)) { + r0 = _gyotoy.builder.get_object("r0").get_value(); + theta0 = _gyotoy.builder.get_object("theta0").get_value(); + phi0 = _gyotoy.builder.get_object("phi0").get_value(); + t0 = _gyotoy.builder.get_object("t0").get_value(); + rprime0 = _gyotoy.builder.get_object("rprime0").get_value(); + thetaprime0 = _gyotoy.builder.get_object("thetaprime0").get_value(); + phiprime0 = _gyotoy.builder.get_object("phiprime0").get_value(); + } _gyotoy_initcoord=[t0, r0, theta0, phi0, rprime0, thetaprime0, phiprime0]; + _gyotoy_t0=t0; if (catch(0x08)) return; // avoid breaking in case of v>c - _gyotoy_txyz=_gyotoy_particle(initcoord=_gyotoy_initcoord(1:4), - _gyotoy_initcoord(5:7), - xfill=_gyotoy_t1, - get_txyz=1); - gyotoy_redraw; + _gyotoy_particle, initcoord=_gyotoy_initcoord(1:4),_gyotoy_initcoord(5:7); + if (_gyotoy_inhibit_redraw) return; + gyotoy_compute_and_draw; } func gyotoy_redraw(void){ @@ -154,27 +223,41 @@ // delta; long(niter); // Purpose of the "if": gyoto_Kerr_orbit will return 0 if v>c - extern _gyotoy_txyz; - + extern _gyotoy_txyz, _gyotoy_inhibit_redraw; + if (_gyotoy_inhibit_redraw) return; if (numberof(_gyotoy_txyz)>1) { - x=_gyotoy_txyz(,2); - y=_gyotoy_txyz(,3); - z=_gyotoy_txyz(,4); + t=_gyotoy_txyz(,1); + n0=abs(t-_gyotoy_t0)(mnx); + n1=abs(t-_gyotoy_t1)(mnx); + if (n1>n0) ++n1; else --n1; + if (n1<1) n1=1; + if (n1>numberof(t)) n1=numberof(t); + if (n1=t0) + t = _gyotoy_txyz(0,1); + else + t = _gyotoy_txyz(1,1); + dt = (_gyotoy_t1-t0)/_gyotoy_nsteps; + if (dt==0) { + gyotoy_warning, "t0 and t1 too close."; + --_gyotoy_redrawing; + return; + } + + if ( ((t-t0)/(_gyotoy_t1-t0)) >=1 ){ + gyotoy_set_play_image, "gtk-media-play"; + gyotoy_set_fraction, (t-t0)/(_gyotoy_t1-t0); + gyotoy_redraw; + --_gyotoy_redrawing; + return; + } + + gyotoy_set_fraction, (t-t0)/(_gyotoy_t1-t0); + gyotoy_set_play_image, "gtk-media-pause"; + + dir = sign(_gyotoy_t1-t0); + + for ( ; + ((dir == 1 && t<=_gyotoy_t1+dt) || + (dir ==-1 && t>=_gyotoy_t1+dt) ) + && !_gyotoy_cancel; + t+=dt) { + _gyotoy_txyz=_gyotoy_particle(xfill=t, get_txyz=1); + if ( ( (dir== 1) && _gyotoy_txyz(0,1) < t) || + ( (dir==-1) && _gyotoy_txyz(1,1) > t) ) + t = _gyotoy_t1+2*dt; + gyotoy_redraw; + //gy_gtk_step_once; + frac=(t-t0)/(_gyotoy_t1-t0); + if (frac>1.) frac=1; + gyotoy_set_fraction, frac; + while (gy.Gtk.events_pending ()) noop, gy.Gtk.main_iteration (); + } + + gyotoy_set_play_image, "gtk-media-play"; + frac=(t-t0)/(_gyotoy_t1-t0); + if (frac>1.) frac=1; + gyotoy_set_fraction, frac; + + gyotoy_redraw; + --_gyotoy_redrawing; + if (_gyotoy_cancel==2) gyotoy_rewind; +} + +func gyotoy_set_play_image(name) +{ + noop, _gyotoy.builder.get_object("play_image"). + set_from_stock(name, gy.Gtk.IconSize.button); +} + +func gyotoy_rewind(wdg, data) +{ + extern _gyotoy_cancel; + if (_gyotoy_redrawing) { + _gyotoy_cancel=2; + return; + } + _gyotoy_particle, reset=; + gyotoy_set_fraction, 0; +} + +func gyotoy_set_fraction(frac) +{ + noop, _gyotoy.builder.get_object("progressbar").set_fraction(frac); +} + +func gyotoy_set_delta(delta, void) { + extern _gyotoy_delta; + if (!is_numerical(delta)) delta = delta.get_value(); + _gyotoy_delta=delta; + _gyotoy_particle, delta=delta; +} + +func gyotoy_inhibit_redraw(mode, data) { + extern _gyotoy_inhibit_redraw, _gyotoy_cancel; + if (!structof(mode)) mode=mode.get_active(); + _gyotoy_inhibit_redraw=mode; + if (mode &&_gyotoy_redrawing) _gyotoy_cancel=1; +} + +func gyotoy_play_pause(wdg, data) +{ + noop, _gyotoy.builder.get_object("inhibit_button").set_active(0); + gyotoy_compute_and_draw; +} + +func gyotoy_export(filename, data) +{ /* DOCUMENT gyotoy_export, filename Save current plot or Gyotoy data to file. @@ -324,7 +589,80 @@ SEE ALSO: gyotoy_import, gyotoy_save_data */ - window, _gyotoy_wid; + + // If filename is not a string, assume open button has been clicked + if (!is_string(filename)) { + Gtk = gy.require("Gtk", "3.0"); + + chooser = Gtk.FileChooserDialog(); + noop, chooser.add_button(Gtk.STOCK_OPEN, Gtk.ResponseType.ok); + noop, chooser.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.cancel); + fcfc = Gtk.FileChooser(chooser); + noop, fcfc.set_action(Gtk.FileChooserAction.save); + noop, fcfc.set_do_overwrite_confirmation(1); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*"); + noop, filter.set_name("All Files"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[tT][xX][tT]"); + noop, filter.add_pattern("*.[dD][aA][tT]"); + noop, filter.add_pattern("*.[pP][dD][fF]"); + noop, filter.add_pattern("*.[eE][pP][sS]"); + noop, filter.add_pattern("*.[jJ][pP][eE][gG]"); + noop, filter.add_pattern("*.[jJ][pP][gG]"); + noop, filter.add_pattern("*.[jJ][fF][iI][fF]"); + noop, filter.add_pattern("*.[pP][nN][gG]"); + noop, filter.set_name("All supported files"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[dD][aA][tT]"); + noop, filter.add_pattern("*.[tT][xX][tT]"); + noop, filter.set_name("Data Files"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[xX][mM][lL]"); + noop, filter.set_name("XML description files"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[pP][dD][fF]"); + noop, filter.set_name("PDF documents"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[eE][pP][sS]"); + noop, filter.set_name("EPS documents"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[jJ][pP][eE][gG]"); + noop, filter.add_pattern("*.[jJ][pP][gG]"); + noop, filter.add_pattern("*.[jJ][fF][iI][fF]"); + noop, filter.set_name("JPEG images"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[pP][nN][gG]"); + noop, filter.set_name("PNG images"); + noop, fcfc.add_filter(filter); + + res = chooser.run(); + noop, chooser.hide(); + if (res == Gtk.ResponseType.OK) { + filename=fcfc.get_filename(); + noop, chooser.destroy(); + } else { + noop, chooser.destroy(); + return; + } + } + + window, _gyotoy.yid; require,"pathfun.i"; ext=pathsplit(filename,delim=".")(0); if (strglob("*.pdf", filename, case=0)) pdf, filename; @@ -341,15 +679,57 @@ else pyk,"warning('Unknown file type for "+filename+"')"; } -func gyotoy_warning(msg) { - pyk, "warning('"+msg+"')"; -} +func gyotoy_import(filename, data) { + extern _gyotoy, _gyotoy_inhibit_redraw; -func gyotoy_import(filename) { + // If filename is not a string, assume open button has been clicked + if (!is_string(filename)) { + Gtk = gy.require("Gtk", "3.0"); + + chooser = Gtk.FileChooserDialog(); + noop, chooser.add_button(Gtk.STOCK_OPEN, Gtk.ResponseType.ok); + noop, chooser.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.cancel); + fcfc = Gtk.FileChooser(chooser); + noop, fcfc.set_action(Gtk.FileChooserAction.open); + noop, fcfc.set_do_overwrite_confirmation(1); + /* + buttons=(Gtk.STOCK_CANCEL, + Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, + Gtk.ResponseType.OK)); + */ + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*"); + noop, filter.set_name("All Files"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[dD][aA][tT]"); + noop, filter.add_pattern("*.[tT][xX][tT]"); + noop, filter.set_name("Data Files"); + noop, fcfc.add_filter(filter); + + filter = Gtk.FileFilter(); + noop, filter.add_pattern("*.[xX][mM][lL]"); + noop, filter.set_name("XML description files"); + noop, fcfc.add_filter(filter); + + res = chooser.run(); + noop, chooser.hide(); + if (res == Gtk.ResponseType.OK) { + filename=fcfc.get_filename(); + noop, chooser.destroy(); + } else { + noop, chooser.destroy(); + return; + } + } + // XML file: if (strpart(filename,-3:0)==".xml") { local rad2deg; rad2deg=180./pi; + _gyotoy, filename=filename; gyotoy_set_particle, gyoto_Astrobj(filename); return; } @@ -363,6 +743,9 @@ gyotoy_warning, filename+" is not a Gyotoy save file"; return; }*/ + rdr=_gyotoy_inhibit_redraw; + _gyotoy_inhibit_redraw=1; + while ((line=rdline(file)) && !strmatch(line,"# Start Gyoto parameters")) {} if (!line) { gyotoy_warning, filename+" is not a Gyoto save file"; @@ -372,21 +755,32 @@ key=""; value=""; sread,line, format="# %s = %s", key, value; + if (key=="metric_file") gyotoy_set_metric, strpart(value, 2:-1); ok=pyk("set_parameter('"+key+"',"+value+")"); } - pyk,"compute_orbit('rien')"; + _gyotoy_inhibit_redraw=rdr; + gyotoy_compute_and_draw; + //pyk,"compute_orbit('rien')"; } func gyotoy_print(truc) {print,truc;} -func gyotoy_set_mass(mass) { +func gyotoy_set_mass(mass, void) +{ extern _gyotoy_mass; + if (!is_numerical(mass)) mass = mass.get_value(); _gyotoy_mass=mass; + gyotoy_redraw; } -func gyotoy_set_particle_type(type) { +func gyotoy_set_particle_type(type, void) +{ extern _gyotoy_particle_is_massless, _gyotoy_particle, _gyotoy_metric; extern _gyotoy_txyz; + if (!is_string(type)) { + if (!type.get_active()) return; + type = gy.Gtk.Buildable(type).get_name(); + } _gyotoy_particle_is_massless = (type=="photon"); if (type=="photon") { _gyotoy_particle_is_massless = 1; @@ -396,11 +790,11 @@ _gyotoy_particle = gyoto_Star(); } if (catch(0x08)) return; // avoid breaking in case of v>c - _gyotoy_txyz=_gyotoy_particle(metric=_gyotoy_metric, - initcoord=_gyotoy_initcoord(1:4), - _gyotoy_initcoord(5:7), - xfill=_gyotoy_t1, get_txyz=1); - gyotoy_redraw; + _gyotoy_particle,metric=_gyotoy_metric, + initcoord=_gyotoy_initcoord(1:4),_gyotoy_initcoord(5:7); + _gyotoy_particle, delta=_gyotoy_delta; + gyotoy_adaptive, _gyotoy_adaptive; + gyotoy_compute_and_draw; } func gyotoy_save_data(filename) { @@ -420,38 +814,111 @@ gyoto_convert, y, _gyotoy_mass, _gyotoy_distance, _gyotoy_unit; gyoto_convert, z, _gyotoy_mass, _gyotoy_distance, _gyotoy_unit; ptype = (_gyotoy_particle_is_massless?"photon":"star"); + mtype = (_gyotoy_metric(kind=)=="KerrBL")?"kerrbl":"file"; spin=(_gyotoy_metric(kind=)=="KerrBL")?_gyotoy_metric(spin=):2; if (f=open(filename,"w",1)) { write, f, format="# %s\n", "Gyoto save file"; write, f, format="# %s\n", "Start Gyoto parameters"; write, f, format="# %13s = \"%s\"\n", "particle_type", ptype; - write, f, format="# %13s = \"%s\"\n", "metric_type", "kerr"; + write, f, format="# %13s = \"%s\"\n", "metric_type", mtype; + if (mtype=="kerrbl") + write, f, format="# %13s = %14.12f\n", "spin", spin; + else + write, f, format="# %13s = \"%s\"\n", "metric_file", _gyotoy_metric_file; write, f, format="# %13s = %14.12f\n", - ["spin", "mass", + ["mass", "t0", "r0", "theta0", "phi0", "rprime0", "thetaprime0", "phiprime0", - "t1"], - _([spin, - _gyotoy_mass], + "t1", "delta"], + _([_gyotoy_mass], _gyotoy_initcoord, - _gyotoy_t1); + _gyotoy_t1, _gyotoy_delta); + write, f, format="# %13s = %d\n", + ["adaptive", "nsteps"], [_gyotoy_adaptive, _gyotoy_nsteps]; write, f, format="# %13s = \"%s\"\n", "length_unit", _gyotoy_unit; write, f, format="# %s\n", "End Gyoto parameters"; write, f, format= "# %s\n", "Columns are t, x, y, z"; write, f, format="%14.12f %14.12f %14.12f %14.12f\n", t, x, y, z; close,f; - } else gyoto_warning, "Could not create file "+filename; + } else error, "Could not create file "+filename; +} + + +/************** CALLBACKS ****************/ +func gyotoy_about(wdg, udata) +{ + Gtk=gy.require("Gtk", "3.0"); + dialog = Gtk.AboutDialog(); + noop, dialog.set_program_name("Gyotoy"); + noop, dialog.set_version(GYOTOY_VERSION); + noop, dialog.set_logo(icon); + noop, dialog.set_copyright("Copyright © 20011-2013 Frédéric Vincent & Thibaut Paumard"); + noop, dialog.set_license_type(Gtk.License.gpl_3_0); + noop, dialog.run(); + noop, dialog.destroy(); +} + +func _gyotoy_orient3(wdg, data) +{ + incl = _gyotoy.builder.get_object("incl").get_value(); + paln = _gyotoy.builder.get_object("paln").get_value(); + phase = _gyotoy.builder.get_object("phase").get_value(); + gyoto_orient3, incl, paln, phase; + //draw3,1; } -extern _pyk_proc, _gyotoy_stand_alone, _gyotoy_wid; -if (is_void(_gyotoy_wid)) _gyotoy_wid=0; +func _gyotoy_metric_type(wdg, data) +{ + type_id = wdg.get_active(); + if (type_id == 0) type = "kerrbl"; + else if (type_id == 1) type = "file"; + + if (type=="file") { + noop, _gyotoy.builder.get_object("spin").set_sensitive(0); + noop, _gyotoy.builder.get_object("spin").set_visible(0); + noop, _gyotoy.builder.get_object("spin_label").set_visible(0); + noop, _gyotoy.builder.get_object("metric_file").set_sensitive(1); + noop, _gyotoy.builder.get_object("metric_file_label").set_visible(1); + noop, _gyotoy.builder.get_object("metric_file").set_visible(1); + // TO PORT + //_gyotoy.metric_file_set_cb(_gyotoy.builder.get_object("metric_file")); + } else if (type=="kerrbl") { + noop, _gyotoy.builder.get_object("spin").set_visible(1); + noop, _gyotoy.builder.get_object("spin").set_sensitive(1); + noop, _gyotoy.builder.get_object("spin_label").set_visible(1); + noop, _gyotoy.builder.get_object("metric_file").set_sensitive(0); + noop, _gyotoy.builder.get_object("metric_file_label").set_visible(0); + noop, _gyotoy.builder.get_object("metric_file").set_visible(0); + gyotoy_set_KerrBL_metric, _gyotoy.builder.get_object("spin"); + } else { + error, "Unknown metric type"; + } +} + +func _gyotoy_gnomon(wdg, data) +{ + gnomon; +} + +func _gyotoy_cage(wdg, data) +{ + cage3; +} + +func _gyotoy_unlimit(wdg, data) +{ + limits; +} + +extern _pyk_proc, _gyotoy_stand_alone; +if (is_void(_gyotoy.yid)) _gyotoy,yid=0; gyotoy_args=get_argv(); if (is_void(GYOTOY_NO_AUTO) & numberof(gyotoy_args)>=3 && anyof(basename(gyotoy_args(3))==["gyotoy.i","gyotoy"])) { _gyotoy_stand_alone=1; if (numberof(gyotoy_args)>3) { gyotoy_args=gyotoy_args(4:); ind=where(strgrep("^-",gyotoy_args)(2,)==-1); - if (numberof(ind)) _gyotoy_filename=gyotoy_args(ind(1)); + if (numberof(ind)) _gyotoy, filename=gyotoy_args(ind(1)); if (numberof(ind). - - - -# import necessary modules -import gtk -import gtk.glade -import sys -import gobject -import os, fcntl, errno -import time - -# define the class -class gyotoy: - - def destroy(self, wdg, data=None): - self.py2yo('gyotoy_quit') - gtk.main_quit() # we'll call this from yorick before it quits. - - def __init__(self,gyotoytop): - gobject.set_application_name("Gyotoy") - gobject.set_prgname("Gyotoy") - - self.gyotoytop = gyotoytop - self._pyk_blocked=0 - self.length_unit="geometrical" - - # read GUI definition - self.glade = gtk.glade.XML(os.path.join(self.gyotoytop,'gyotoy.glade')) - - # handle destroy event (so that we can kill the window through window bar) - self.window = self.glade.get_widget('window1') - if (self.window): - self.window.connect('destroy', self.destroy) - - # autoconnect to callback functions - # this will automatically connect the event handler "on_something_event" - # to the here-defined function of the same name. This avoid defining a - # long dictionary that serves the same purpose - self.glade.signal_autoconnect(self) - - # set stdin non blocking, this will prevent readline to block - # stdin is coming from yorick (yorick spawned this python process) - fd = sys.stdin.fileno() - flags = fcntl.fcntl(fd, fcntl.F_GETFL) - fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) - - # ... and add stdin to the event loop (yorick input pipe by spawn) - gobject.io_add_watch(sys.stdin,gobject.IO_IN|gobject.IO_HUP,self.yo2py,None) - - # run: realize the interface, start event management - gtk.main() - - # callback functions - # This is the important, user-defined heart of this file. - # here, you define the function that will be called when an event is raised - # (read: happens): a button is pressed, a slider is moved, you enter a - # drawingarea or move the cursor, etc... Just define a handler (callback) of - # the same name in the glade UI definition (see signals) and you're done. - - def set_metric(self, wdg): - spin = self.glade.get_widget('spin').get_value() - self.py2yo('gyotoy_set_KerrBL_metric %14.12f' % (spin)) - - def set_mass(self, wdg): - mass = self.glade.get_widget('mass').get_value() - self.py2yo('gyotoy_set_mass %14.12f' % (mass)) - - def set_initcoord(self, wdg): - r0 = self.glade.get_widget('r0').get_value() - theta0 = self.glade.get_widget('theta0').get_value() - phi0 = self.glade.get_widget('phi0').get_value() - t0 = self.glade.get_widget('t0').get_value() - rprime0 = self.glade.get_widget('rprime0').get_value() - thetaprime0 = self.glade.get_widget('thetaprime0').get_value() - phiprime0 = self.glade.get_widget('phiprime0').get_value() - self.py2yo('gyotoy_set_initcoord %14.12f %14.12f %14.12f %14.12f %14.12f %14.12f %14.12f' % (t0, r0, theta0, phi0, rprime0, thetaprime0, phiprime0)) - - def set_distance(self,wdg): - distance = self.glade.get_widget('distance').get_value() - self.py2yo('gyotoy_set_distance %14.12f' % (distance)) - - def set_t1(self,wdg): - t1 = self.glade.get_widget('t1').get_value() - self.py2yo('gyotoy_set_t1 %14.12f' % (t1)) - - def orient3(self, wdg): - incl = self.glade.get_widget('incl').get_value() - paln = self.glade.get_widget('paln').get_value() - phase = self.glade.get_widget('phase').get_value() - self.py2yo("gyoto_orient3 %14.12f %14.12f %14.12f" % (incl, paln, phase)) - - def sleep(self,delay): - time.sleep(delay) - self.pyk_resume("1") - - def metric_type_map(self,wdg, *args): - self.glade.get_widget('metric_type').set_active(0) - - def on_drawingarea_map_event(self,wdg,*args): -# time.sleep(2) - self.glade.get_widget('metric_type').set_active(0) - drawingarea = self.glade.get_widget('yorick_window') - mwid = drawingarea.window.xid; - self.py2yo('gyotoy_window_init %d' % mwid) - self.orient3(wdg) - #self.outfile="" - # optionaly (but this is a good place to - # do it), update GUI parameters from yorick: - # self.py2yo('gui_update') - # minimal wrapper for yorick/python communication - # This is really internal to the yorick/python communication and you should - # not have to fiddle with it - - def on_save_as_activate(self,wdg): - chooser = gtk.FileChooserDialog(title="Save plot or data to file",action=gtk.FILE_CHOOSER_ACTION_SAVE,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) - - filter = gtk.FileFilter() - filter.add_pattern('*') - filter.set_name('All Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[pP][dD][fF]') - filter.add_pattern('*.[pP][nN][gG]') - filter.add_pattern('*.[jJ][pP][gG]') - filter.add_pattern('*.[eE][pP][sS]') - filter.set_name('Supported image files (PDF, PNG, JPG and EPS)') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[dD][aA][tT]') - filter.add_pattern('*.[tT][xX][tT]') - filter.set_name('Data Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[pP][dD][fF]') - filter.set_name('PDF Image Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[pP][nN][gG]') - filter.set_name('PNG Image Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[jJ][pP][gG]') - filter.set_name('JPG Image Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[eE][pP][sS]') - filter.set_name('EPS Image Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[xX][mM][mL]') - filter.set_name('XML description files') - chooser.add_filter(filter) - - res = chooser.run() - if res == gtk.RESPONSE_OK: - file=chooser.get_filename() - self.set_filename(file) - self.py2yo('gyotoy_export "'+file+'"') - chooser.destroy() - - def on_save_activate(self,wdg): - self.py2yo('gyotoy_export "'+self.outfile+'"') - - def on_open_activate(self,wdg): - chooser = gtk.FileChooserDialog(title="Open Gyotoy data file",action=gtk.FILE_CHOOSER_ACTION_OPEN,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) - - filter = gtk.FileFilter() - filter.add_pattern('*') - filter.set_name('All Files') - chooser.add_filter(filter) - - filter = gtk.FileFilter() - filter.add_pattern('*.[dD][aA][tT]') - filter.add_pattern('*.[tT][xX][tT]') - filter.set_name('Data Files') - chooser.add_filter(filter) - - res = chooser.run() - if res == gtk.RESPONSE_OK: - file=chooser.get_filename() - self.set_filename(file) - self.py2yo('gyotoy_import "'+file+'"') - chooser.destroy() - - def set_parameters_text(self, parameters, values): - self.set_parameter_text(parameters[0],values[0]) - self.set_parameter_text(parameters[1],values[1]) - self.set_parameter_text(parameters[2],values[2]) - self.set_parameter_text(parameters[3],values[3]) - self.set_parameter_text(parameters[4],values[4]) - - def set_length_unit(self, wdg): - if wdg.get_active(): - self.py2yo('gyotoy_set_unit "%s"' % (wdg.get_name())) - - def set_particle_type(self, wdg): - self.py2yo('gyotoy_set_particle_type "%s" ' % (wdg.get_name())) - - def set_parameter_text(self, param, value): - self.glade.get_widget(param).set_text(value) - - def set_parameter(self, param, value): - if (param=='metric_type'): - self.glade.get_widget('metric_type').set_active(0) - elif (param=='length_unit' or param=='particle_type'): - self.glade.get_widget(value).set_active(1) - else: - self.glade.get_widget(param).set_value(value) - count=0 - while (self.glade.get_widget(param).get_value()!=value): - time.sleep(1) - count+=1 - if (count==5): - self.py2yo('print "%s" %.12f %.12f' % (param, value, self.glade.get_widget(param).get_value())) - self.yerror('Unable to set value') - if (param=='spin'): - self.set_metric(self.glade.get_widget(param)) - self.pyk_resume('1') - - def toggle_gnomon(self,wdg): - self.py2yo('gnomon') - - def toggle_cage(self,wdg): - self.py2yo('cage3') - - def limits(self,wdg): - self.py2yo('limits') - - def toggle_reticle(self,wdg): - self.py2yo('gyotoy_toggle_reticle') - #mwid = self.glade.get_widget('yorick_window').window.xid; - #self.py2yo('gyotoy_toggle_window_style %d' % mwid) - self.redraw('rien') - - def redraw(self,wdg): - self.py2yo('gyotoy_redraw') - - - def about_window(self,wdg): - dialog = self.glade.get_widget('aboutdialog') - dialog.run() - dialog.hide() - - def warning(self,msg): - mbox = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, 'Gyotoy Warning'); - mbox.format_secondary_markup(msg); - #,message-type=gtk.MESSAGE_WARNING,buttons=gtk.BUTTONS_OK); - res=mbox.run(); - mbox.destroy(); - - def set_filename(self,file): - self.outfile=file - self.glade.get_widget('save_button').set_sensitive(1) - self.window.set_title("Gyotoy - "+file) - -# pyk functions - - def pyk_sync(self): - self._pyk_blocked=1 - sys.stdout.write('-s+y-n+c-+p-y+k-\n') - sys.stdout.flush() - - def pyk_resume(self,msg): - if (self._pyk_blocked): - self.py2yo('pyk_resume ' + msg) - self._pyk_blocked=0 - - def py2yo(self,msg): - # sends string command to yorick - sys.stdout.write(msg+'\n') - sys.stdout.flush() - - def yo2py(self,cb_condition,*args): - if cb_condition == gobject.IO_HUP: - raise SystemExit, "lost pipe to yorick" - # handles string command from yorick - # note: inidividual message needs to end with \n for proper ungarbling - while 1: - try: - msg = sys.stdin.readline() - msg = "self."+msg - exec(msg) - except IOError, e: - if e.errno == errno.EAGAIN: - # the pipe's empty, good - break - # else bomb out - self.yerror(str(e)) - raise SystemExit, "yo2py unexpected IOError:" + str(e) - except Exception, e: -# raise SystemExit, "yo2py unexpected Exception:" + str(ee) - self.yerror(str(e)) - raise SystemExit, "yo2py unexpected Exception:" + str(ee) +msg - return True - - def yerror(self, msg): - if (self._pyk_blocked): - self.pyk_resume('0') - self.py2yo('error "%s"' % msg) - -# check calling syntax (should not be a problem as it is always called -# from yorick - -if len(sys.argv) != 2: - print 'Usage: gyotoy.py path_to_glade' - raise SystemExit - -# get path to glade file -gyotoytop = str(sys.argv[1]) -# execute it -top = gyotoy(gyotoytop) Binary files /tmp/ZU7Hh9jCzy/gyoto-0.0.3/yorick/gyotoy.xcf and /tmp/vmQvsUaul5/gyoto-0.1.0/yorick/gyotoy.xcf differ diff -Nru gyoto-0.0.3/yorick/gyotoy.xml gyoto-0.1.0/yorick/gyotoy.xml --- gyoto-0.0.3/yorick/gyotoy.xml 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/gyotoy.xml 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,1408 @@ + + + + + 99 + 0.01 + 0.01 + 1 + + + 0.01 + 1000000 + 8 + 1 + 10 + + + -360 + 360 + 120 + 1 + 10 + + + 1 + 1e+20 + 4000000 + 1000 + 100000 + + + + + + + + + + + KerrBL + kerrbl + + + From XML file + file + + + + + 1 + 10000000 + 100 + 10 + 100 + + + -360 + 360 + -180 + 1 + 10 + + + True + False + + 975 + 600 + + + True + False + + + True + False + + + False + True + False + _Fichier + True + + + True + False + + + gtk-open + False + True + False + True + True + + + + + + gtk-save-as + False + True + False + True + True + + + + + + True + False + + + + + gtk-quit + False + True + False + True + True + + + + + + + + + + False + True + False + _Affichage + True + + + True + False + + + False + True + False + Toggle gnomon + True + + + + + + False + True + False + Toggle cage + True + + + + + + False + True + False + Toggle reticle + True + + + + + + False + True + False + Reset 2D limits + True + + + + + + False + True + False + Length unit + True + + + True + False + + + False + True + False + Geometrical unit + True + True + + + + + + False + True + False + Meter + True + geometrical + + + + + + False + True + False + Kilometer + True + geometrical + + + + + + False + True + False + Solar radius + True + geometrical + + + + + + False + True + False + Arc second + True + geometrical + + + + + + False + True + False + Milliarcsecond + True + geometrical + + + + + + False + True + False + Microarcsecond + True + geometrical + + + + + + + + + + + + + + False + True + False + Aid_e + True + + + True + False + + + gtk-about + False + True + False + True + True + + + + + + + + + + False + True + 0 + + + + + True + True + True + 475 + True + + + True + False + True + + + + + + False + True + + + + + True + True + in + + + True + False + + + True + False + 26 + 2 + + + True + True + True + Integrate from t0 to t1 +Geometrical units + Integrate from t0 to t1 +Geometrical units + 40 + â— + 20 + False + False + t1_adjustment + 17 + + + + 1 + 2 + 25 + 26 + + + + + True + False + True + Integrate from t0 to t1 +Geometrical units + Integrate from t0 to t1 +Geometrical units + tâ‚ + + + 25 + 26 + + + + + True + False + Integration parameters + + + 2 + 24 + 25 + + + + + True + False + True + Incination of the equatorial plane +Degrees + Incination of the equatorial plane +Degrees + Inclination + + + 20 + 21 + + + + + True + False + True + Position angle of the line of nodes +Degrees + Position angle of the line of nodes +Degrees + PALN + + + 19 + 20 + + + + + True + False + True + Argument of the x axis +Degrees + Argument of the x axis +Degrees + Phase + + + 21 + 22 + + + + + True + True + True + Incination of the equatorial plane +Degrees + Incination of the equatorial plane +Degrees + 22 + â— + 20 + False + False + incl_adjustment + 17 + + + + 1 + 2 + 20 + 21 + + + + + True + True + True + Position angle of the line of nodes +Degrees + Position angle of the line of nodes +Degrees + 22 + â— + 20 + False + False + paln_adjustment + 0.050000000000000003 + 17 + + + + 1 + 2 + 19 + 20 + + + + + True + True + True + Argument of the x axis +Degrees + Argument of the x axis +Degrees + 22 + â— + 20 + False + False + phase_adjustment + 17 + + + + 1 + 2 + 21 + 22 + + + + + True + False + Projection + + + 2 + 18 + 19 + + + + + True + True + True + Radians per geometrical units + Radians per geometrical units + 20 + â— + 20 + False + False + phiprime0_adjustment + 17 + + + + 1 + 2 + 16 + 17 + + + + + True + False + True + Radians per geometrical units + Radians per geometrical units + dφ/dt + + + 16 + 17 + + + + + True + True + True + Radians per geometrical units + Radians per geometrical units + 20 + â— + 20 + False + False + thetaprime0_adjustment + 17 + + + + 1 + 2 + 15 + 16 + + + + + True + True + True + Relative to light speed + Relative to light speed + 20 + â— + 20 + False + False + rprime0_adjustment + 17 + + + + 1 + 2 + 14 + 15 + + + + + True + True + True + Date for initial condition +Geometrical units + Date for initial condition +Geometrical units + 40 + â— + 20 + False + False + t0_adjustment + 17 + + + + 1 + 2 + 13 + 14 + + + + + True + True + True + Radians + Radians + 20 + â— + 20 + False + False + phi0_adjustment + 17 + + + + 1 + 2 + 12 + 13 + + + + + True + True + True + Radians + Radians + 20 + â— + 20 + False + False + theta0_adjustment + 17 + + + + 1 + 2 + 11 + 12 + + + + + True + True + True + Initial distance from center +Geometrical units + Initial distance from center +Geometrical units + 20 + â— + 20 + False + False + r0_adjustment + 17 + + + + 1 + 2 + 10 + 11 + + + + + True + False + True + Radians per geometrical units + Radians per geometrical units + dθ/dt + 10 + + + 15 + 16 + + + + + True + False + True + Relative to light speed + Relative to light speed + dr/dt + + + 14 + 15 + + + + + True + False + True + Date for initial condition +Geometrical units + Date for initial condition +Geometrical units + tâ‚€ + + + 13 + 14 + + + + + True + False + True + Radians + Radians + φ₀ + + + 12 + 13 + + + + + True + False + True + Radians + Radians + θ₀ + + + 11 + 12 + + + + + True + False + True + Initial distance from center +Geometrical units + Initial distance from center +Geometrical units + râ‚€ + + + 10 + 11 + + + + + True + False + Initial conditions + + + 2 + 9 + 10 + + + + + True + False + True + Spin parameter +For Kerr metric only + Spin parameter +For Kerr metric only + Spin param. + + + 6 + 7 + + + + + True + True + True + Spin parameter +For Kerr metric only + Spin parameter +For Kerr metric only + 20 + â— + 20 + 0.14000000059604645 + False + False + spin_adjustment + 17 + True + + + + 1 + 2 + 6 + 7 + + + + + True + False + True + Type of metric + Type of metric + Type + 12 + + + 4 + 5 + + + + + True + False + True + Type of metric + Type of metric + metric_type_liststore + 0 + + + + + 0 + + + + + 1 + 2 + 4 + 5 + + + + + True + False + Metric parameters + + + 2 + 3 + 4 + + + + + True + False + + + 2 + 23 + 24 + + + + + True + False + + + 2 + 17 + 18 + + + + + True + False + + + 2 + 8 + 9 + + + + + True + False + True + Compact object mass for scaling geometrical unit +Solar masses + Compact object mass for scaling geometrical unit +Solar masses + Mass + + + 7 + 8 + + + + + True + True + True + Compact object mass for scaling geometrical unit +Solar masses + Compact object mass for scaling geometrical unit +Solar masses + â— + False + False + mass_adjustment + 17 + + + + 1 + 2 + 7 + 8 + + + + + True + False + True + Distance from observer +Kiloparsecs + Distance from observer +Kiloparsecs + Distance + + + 22 + 23 + + + + + True + True + True + Distance from observer +Kiloparsecs + Distance from observer +Kiloparsecs + â— + False + False + distance_adjustment + 17 + + + + 1 + 2 + 22 + 23 + + + + + False + + + 2 + 2 + 3 + + + + + True + False + Particle type + + + 2 + + + + + True + False + True + + + Star + False + True + True + False + True + Compute massive-particle orbit +(Timelike geodesic) + Compute massive-particle orbit +(Timelike geodesic) + False + 0 + True + True + + + + True + True + 0 + + + + + Photon + False + True + True + False + True + Compute massless particle trajectory +(Null geodesic) + Compute massless particle trajectory +(Null geodesic) + False + 0 + True + star + + + + True + True + 1 + + + + + 2 + 1 + 2 + + + + + False + False + True + True + Gyoto XML file containing metric +Any kind of Gyoto XML as long as a metric is included + Gyoto XML file containing metric +Any kind of Gyoto XML as long as a metric is included + vertical + + + + 1 + 2 + 5 + 6 + + + + + False + True + True + Gyoto XML file containing metric +Any kind of Gyoto XML as long as a metric is included + Gyoto XML file containing metric +Any kind of Gyoto XML as long as a metric is included + File + + + 5 + 6 + + + + + + + + + True + True + + + + + True + True + 1 + + + + + True + False + + + True + False + True + + + True + True + 0 + + + + + True + False + Integration step in proper time +Geometrical units +Initial if step is adaptive + 5 + δ + + + False + True + 1 + + + + + True + True + Integration step in proper time +Geometrical units +Initial if step is adaptive + â— + 6 + delta_adjustment + 4 + True + + + + False + True + 2 + + + + + False + True + True + True + Push-in for non-adaptive δ + False + none + + + + True + False + gtk-zoom-100 + + + + + False + True + 3 + + + + + True + False + Split t0 to t1 integration in N frames + 5 + N. frames + + + False + True + 4 + + + + + True + True + Split t0 to t1 integration in N frames + â— + 4 + nsteps_adjustment + True + + + + False + True + 5 + + + + + False + True + True + True + Pause and reset integration + False + none + + + + True + False + Pause and reset integration + gtk-goto-first + + + + + False + True + 6 + + + + + False + True + True + True + Integrate / pause integration + False + none + + + + True + False + gtk-media-play + + + + + False + True + 7 + + + + + False + True + True + True + Push-in to inhibit redraw +upon parameter changes + False + none + + + + True + False + gtk-media-stop + + + + + False + True + 8 + + + + + False + False + 2 + + + + + + + -360 + 360 + -120 + 1 + 10 + + + -4 + 4 + 0.01 + 0.10000000000000001 + + + -10 + 10 + 0.016664000000000002 + 0.01 + 0.10000000000000001 + + + 1000000 + 10.789999999999999 + 1 + 10 + + + -10 + 10 + 0.01 + 0.10000000000000001 + + + 1 + 0.995 + 0.01 + 0.10000000000000001 + + + -1000000 + 1000000 + 1 + 10 + + + -10000000000 + 10000000000 + 3000 + 1 + 10 + + + 4 + 1.5707963267948966 + 0.01 + 0.10000000000000001 + + + -10 + 10 + 0.01 + 0.10000000000000001 + + diff -Nru gyoto-0.0.3/yorick/mk-movie-fork-raytracing.i gyoto-0.1.0/yorick/mk-movie-fork-raytracing.i --- gyoto-0.0.3/yorick/mk-movie-fork-raytracing.i 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/mk-movie-fork-raytracing.i 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,99 @@ +#!/usr/bin/env yorick +/* + This script examplifies how to make a movie using Gyoto and LibAV. + + There is an unconspicuous bug in Gyoto by which mutlithreaded + ray-tracing corrupts the process memory (presumably some block is + freed in one thread whereas it is still used by the main + thread). We seem to work around this bug by performing the + ray-tracing of each image in a separate (multi-threaded) yorick + process. Therefore, this script is mutli-process (main process + writes movie file, subprocesses compute images), and the Gyoto + subprocesses are multi-threaded. + + Required packages: + gyoto (gyoto_Scenery) https://github.com/gyoto/Gyoto + yorick-av (av_*) https://github.com/paumard/yorick-av + yorick-svipc (ftok, fork, s?m_*) https://github.com/mdcb/yp-svipc + yutils (tic, tac) https://github.com/frigaut/yorick-yutils + + */ +#include "svipc.i" +#include "gyoto.i" +#include "libav.i" + + +//// PARAMETERS +ifile="../doc/examples/example-moving-star.xml"; +ofile="test.ogg"; +vcodec="libtheora"; +resolution=64; +t0=1000.; +nframes=1000; +dt=1.; +//gyoto_verbose,0; +//// END PARAMETERS + +tic; // Initialize time counter + +file_i=current_include(); +ppid=getpid(); +shmid = ftok(file_i, proj=ppid); +semid = ftok(file_i, proj=ppid+1); + +sem_init, semid, nums=2; +shm_init, shmid, slots=1; + +// Semaphores are used in this script to lock the shared memory +// segment. Gyoto write to shared memory and gives 0. FFmpeg reads +// from shared memory and gives 1. Initially, FFmpeg gives 1 (nothing +// to read) and takes 0 (waiting for frame). + +// Reading palette using plain Yorick requires an X11 window +window; +pli, array(double, 2,2); +palette, query=1, r,g,b; +rgb= transpose([r,g,b]); +top=numberof(r)-1; +winkill; + +// Reading and initializing scenery +sc=gyoto_Scenery(ifile); +ut = sc(metric=)(unitlength=)/GYOTO_C; +sc,quantities="Intensity"; +sc,nthreads=2; +noop, sc(screen=)(time=t0*ut); +noop, sc(screen=)(resolution=resolution); +// Specific to star astrobj: precompute orbit +ao = sc(astrobj=); +if (ao(kind=)=="Star") noop, ao(xfill=0.); + +sem_give, semid, 1; // Give 1: Gyoto may write to shared memory. +encoder=av_create(ofile, vcodec=vcodec); + +for (n=1, t=t0; n<=nframes; ++n, t+=dt) { + if (fork()) { + sem_take, semid, 0; // Is there something to read now? + im = shm_read(shmid, "image"); + if (n==1) cmax=max(im); + frame = rgb(,bytscl(im(,0:1:-1), cmax=cmax, top=top)+1); + sem_give, semid, 1; // Reading done, Gyoto may write again. + write, format="Writting frame nr %d to movie file\n", n; + av_write, encoder, frame; + } else { + write, format="Ray-tracing frame nr %d, time=%e\n", n, t; + noop, sc(screen=)(time=t*ut); + im = gyoto_Scenery_rayTrace(sc); + sem_take, semid, 1; // May we write now? + shm_write, shmid, "image", &im; + sem_give, semid, 0; // Image ready to be read. + quit; + } + } + +av_close, encoder; + +sem_cleanup, semid; +shm_cleanup, shmid; + +write, format="\nRay-traced %d frames in %g seconds\n", nframes, tac(); diff -Nru gyoto-0.0.3/yorick/mk-movie.i gyoto-0.1.0/yorick/mk-movie.i --- gyoto-0.0.3/yorick/mk-movie.i 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/mk-movie.i 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,59 @@ +#!/usr/bin/env yorick +/* + This script examplifies how to make a movie using Gyoto and LibAV. + + As of writing there is a bug in Gyoto which makes this script + occasionaly fail with a segmentation fault or message such as +yorick(20187,0x7fff706cdcc0) malloc: *** error for object 0x10038d0c8: incorrect checksum for freed object - object was probably modified after being freed. + + mk-movie-fork-raytracing.i tries to work around this bug by + insulating each call to gyoto_Scenery_rayTrace in its own process. + + Required packages: + gyoto (gyoto_Scenery) + yorick-av (av_*) + yutils (tic, tac) + */ + +#include "gyoto.i" +#include "pnm.i" +#include "libav.i" + +ifile="../doc/examples/example-moving-star.xml"; +ofile="test.ogg"; +resolution=64; +nthreads=2; +//gyoto_verbose,0; + +tic; + +t0=1000.; +nframes=2000; +dt=1.; + +sc=gyoto_Scenery(ifile); +ut = sc(metric=)(unitlength=)/GYOTO_C; +sc,quantities="Intensity"; +sc,nthreads=nthreads; +noop, sc(screen=)(time=t0*ut); +noop, sc(screen=)(resolution=resolution); +encoder=av_create(ofile); + +window; +pli, array(double, 2,2); +palette, query=1, r,g,b; +rgb= transpose([r,g,b]); +top=numberof(r)-1; +winkill; + +for (n=1, t=t0; n<=nframes; ++n, t+=dt) { + write, format="\nRay-tracing frame nr %d, observing time=%e\n", n, t; + noop, sc(screen=)(time=t*ut); + im = gyoto_Scenery_rayTrace(sc); + if (n==1) cmax=max(im); + frame = rgb(,bytscl(im(,0:1:-1), cmax=cmax, top=top)+1); + av_write, encoder, frame; + } + +av_close, encoder; +write, format="\nRay-traced %d frames in %g seconds\n", nframes, tac(); diff -Nru gyoto-0.0.3/yorick/stdplug/Makefile gyoto-0.1.0/yorick/stdplug/Makefile --- gyoto-0.0.3/yorick/stdplug/Makefile 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -# these values filled in by yorick -batch make.i -Y_MAKEDIR= -Y_EXE= -Y_EXE_PKGS= -Y_EXE_HOME= -Y_EXE_SITE= -Y_HOME_PKG= - -# ----------------------------------------------------- optimization flags - -# options for make command line, e.g.- make COPT=-g TGT=exe -COPT=$(COPT_DEFAULT) -TGT=$(DEFAULT_TGT) - -# ------------------------------------------------ macros for this package - -include ../../local_settings - -YGYOTO_C = $(shell ls ../*.C) -GYOTO_C = $(shell ls ../../lib/*.C) -GYOTO_OBJ = $(GYOTO_C:.C=.o) -GYOTO_H = $(shell ls ../../include/*.h) - -PKG_NAME=gyoto_std -PKG_I=gyoto_std.i gyoto_Kerr.i gyoto_Star.i - -OBJS = StdPlug.o gyoto_KerrBL.o gyoto_KerrKS.o \ - gyoto_Star.o gyoto_FixedStar.o \ - gyoto_Torus.o gyoto_PageThorneDisk.o gyoto_PatternDisk.o \ - gyoto_Disk3D.o \ - gyoto_PowerLawSpectrum.o gyoto_BlackBodySpectrum.o - -# change to give the executable a name other than yorick -PKG_EXENAME=yorick - -# PKG_DEPLIBS=-Lsomedir -lsomelib for dependencies of this package -PKG_DEPLIBS=-L../../lib -lgyoto - -ifeq ($(SYS),Darwin) -PKG_DEPLIBS+=-bundle_loader ../../lib/libgyoto-stdplug.$(DYLIB_SFX) \ - -flat_namespace -bundle_loader ../gyoto.so $(LIB_CXX) -endif - -# set compiler (or rarely loader) flags specific to this package -PKG_CFLAGS= -I../../include -I.. -PKG_LDFLAGS= - -# list of additional package names you want in PKG_EXENAME -# (typically Y_EXE_PKGS should be first here) -EXTRA_PKGS=$(Y_EXE_PKGS) - -# list of additional files for clean -PKG_CLEAN= - -# autoload file for this package, if any -PKG_I_START= -# non-pkg.i include files for this package, if any -PKG_I_EXTRA= - -# -------------------------------- standard targets and rules (in Makepkg) - -# set macros Makepkg uses in target and dependency names -# DLL_TARGETS, LIB_TARGETS, EXE_TARGETS -# are any additional targets (defined below) prerequisite to -# the plugin library, archive library, and executable, respectively -PKG_I_DEPS=$(PKG_I) -Y_DISTMAKE=distmake - -include $(Y_MAKEDIR)/Make.cfg -include $(Y_MAKEDIR)/Makepkg -include $(Y_MAKEDIR)/Make$(TGT) - -# override macros Makepkg sets for rules and other macros -# Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable) -Y_HOME=$(Y_EXE_HOME) -Y_SITE=$(Y_EXE_SITE) - -# ------------begin C++ source hacks -# must use C++ to load yorick with this C++ package -# this assumes make default CXX macro points to C++ compiler -CXXFLAGS=$(CFLAGS) $(GYOTO_FLAGS) -DYGYOTO_LOCAL_SUPPLIER=GyotoStdPlugSupplier -LD_DLL=$(CXX) $(LDFLAGS) $(PLUG_SHARED) -LD_EXE=$(CXX) $(LDFLAGS) $(PLUG_EXPORT) - -# C++ has no standard file extension, supply default make rule(s) -.C.o: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< -# --------------end C++ source hacks - -# simple example: -#myfunc.o: myapi.h -# more complex example (also consider using PKG_CFLAGS above): -#myfunc.o: myapi.h myfunc.c -# $(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c - - -StdPlug.o: ../ygyoto_supplier.C ../ygyoto.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< - -../../lib/libgyoto.a: $(GYOTO_C) $(GYOTO_H) - make -C ../lib - -gyoto_std.so: $(OBJS) ../../lib/libgyoto-stdplug.$(DYLIB_SFX) - -../../lib/libgyoto-stdplug.$(DYLIB_SFX): ../../lib/*.C - cd ../../lib/ ; make libgyoto-stdplug.$(DYLIB_SFX) - -.PHONY: standalone test-cppprog test-standalone test test-plugin check - -# -------------------------------------------------------- end of Makefile diff -Nru gyoto-0.0.3/yorick/stdplug/Makefile.in gyoto-0.1.0/yorick/stdplug/Makefile.in --- gyoto-0.0.3/yorick/stdplug/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/Makefile.in 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,124 @@ +# these values filled in by yorick -batch make.i +Y_MAKEDIR= +Y_EXE= +Y_EXE_PKGS= +Y_EXE_HOME= +Y_EXE_SITE= +Y_HOME_PKG= + +# ----------------------------------------------------- optimization flags + +# options for make command line, e.g.- make COPT=-g TGT=exe +COPT=$(COPT_DEFAULT) -L../../lib -I../../include +TGT=$(DEFAULT_TGT) + +# ------------------------------------------------ macros for this package + +CPPFLAGS=@CPPFLAGS@ +XERCESLDFLAGS=@XERCESLDFLAGS@ +XERCESCPPFLAGS=@XERCESCPPFLAGS@ +CFITSIOLDFLAGS=@CFITSIOLDFLAGS@ +CFITSIOCPPFLAGS=@CFITSIOCPPFLAGS@ +UDUNITS_CPPFLAGS=@UDUNITS_CPPFLAGS@ +UDUNITS_LDFLAGS=@UDUNITS_LDFLAGS@ +DYLIB_VAR=@DYLIB_VAR@ +PTHREAD_CFLAGS= @PTHREAD_CFLAGS@ +PTHREAD_LIBS= @PTHREAD_LIBS@ +SYS=@SYS@ +plugin_sfx=@plugin_sfx@ + +YGYOTO_C = $(shell ls ../*.C) +GYOTO_C = $(shell ls ../../lib/*.C) +GYOTO_OBJ = $(GYOTO_C:.C=.o) +GYOTO_H = $(shell ls ../../include/*.h) + +PKG_NAME=gyoto_std +PKG_I=gyoto_std.i + +OBJS = StdPlug.o gyoto_KerrBL.o gyoto_KerrKS.o \ + gyoto_Star.o gyoto_FixedStar.o \ + gyoto_Torus.o gyoto_PatternDisk.o \ + gyoto_Disk3D.o gyoto_PolishDoughnut.o\ + gyoto_PowerLawSpectrum.o gyoto_BlackBodySpectrum.o + +# change to give the executable a name other than yorick +PKG_EXENAME=yorick + +# PKG_DEPLIBS=-Lsomedir -lsomelib for dependencies of this package +PKG_DEPLIBS=-L../../lib/.libs -lgyoto $(PTHREADS_LIBS) + +ifeq ($(SYS),Darwin) +PKG_DEPLIBS+=-bundle_loader ../../lib/.libs/libgyoto-stdplug.$(plugin_sfx) \ + -flat_namespace -bundle_loader ../gyoto.so $(LIB_CXX) +endif + +# set compiler (or rarely loader) flags specific to this package +PKG_CFLAGS= -I../../include -I.. $(XERCESCPPFLAGS) $(CFITSIOCPPFLAGS) $(UDUNITS_CPPFLAGS) $(PTHREAD_CFLAGS) +PKG_LDFLAGS= $(PTHREAD_CFLAGS) + +# list of additional package names you want in PKG_EXENAME +# (typically Y_EXE_PKGS should be first here) +EXTRA_PKGS=$(Y_EXE_PKGS) + +# list of additional files for clean +PKG_CLEAN= + +# autoload file for this package, if any +PKG_I_START= +# non-pkg.i include files for this package, if any +PKG_I_EXTRA= + +# -------------------------------- standard targets and rules (in Makepkg) + +# set macros Makepkg uses in target and dependency names +# DLL_TARGETS, LIB_TARGETS, EXE_TARGETS +# are any additional targets (defined below) prerequisite to +# the plugin library, archive library, and executable, respectively +PKG_I_DEPS=$(PKG_I) +Y_DISTMAKE=distmake + +include $(Y_MAKEDIR)/Make.cfg +include $(Y_MAKEDIR)/Makepkg +include $(Y_MAKEDIR)/Make$(TGT) + +# override macros Makepkg sets for rules and other macros +# Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable) +Y_HOME=$(Y_EXE_HOME) +Y_SITE=$(Y_EXE_SITE) + +# Actual install directories set with ./configure --with-yorick-* +prefix=@prefix@ +exec_prefix=@exec_prefix@ +DEST_Y_HOME=$(DESTDIR)@Y_INST_HOME@ +DEST_Y_SITE=$(DESTDIR)@Y_INST_SITE@ + +# ------------begin C++ source hacks +# must use C++ to load yorick with this C++ package +# this assumes make default CXX macro points to C++ compiler +CXXFLAGS=$(CFLAGS) $(GYOTO_FLAGS) -DYGYOTO_LOCAL_SUPPLIER=GyotoStdPlugSupplier +LD_DLL=$(CXX) $(LDFLAGS) $(PLUG_SHARED) +LD_EXE=$(CXX) $(LDFLAGS) $(PLUG_EXPORT) + +# C++ has no standard file extension, supply default make rule(s) +.C.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< +# --------------end C++ source hacks + +# simple example: +#myfunc.o: myapi.h +# more complex example (also consider using PKG_CFLAGS above): +#myfunc.o: myapi.h myfunc.c +# $(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c + + +StdPlug.o: ../ygyoto_supplier.C ../ygyoto.h + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< + +../../lib/libgyoto.a: $(GYOTO_C) $(GYOTO_H) + make -C ../lib + +gyoto_std.so: $(OBJS) + +.PHONY: standalone test-cppprog test-standalone test test-plugin check + +# -------------------------------------------------------- end of Makefile diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_BlackBodySpectrum.C gyoto-0.1.0/yorick/stdplug/gyoto_BlackBodySpectrum.C --- gyoto-0.0.3/yorick/stdplug/gyoto_BlackBodySpectrum.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_BlackBodySpectrum.C 2013-07-27 09:14:20.000000000 +0000 @@ -35,78 +35,23 @@ using namespace YGyoto::Spectrum; using namespace std; -void YGyoto::Spectrum::BlackBodyYEval(SmartPointer * sp_, int argc) { - if (debug()) cerr << "in BlackBodyYEval()" << endl; - int rvset[1]={0}, paUsed[1]={0}, constructor=0; - - // If needed, create the object. - if (!sp_) { // Constructor mode - constructor=1; - sp_ = ypush_Spectrum(); - } else *ypush_Spectrum()=*sp_; +void YGyoto::Spectrum::BlackBodyYEval(SmartPointer * OBJ_, int argc) { - // Parse arguments static char const * knames[]={ + "unit", "temperature", "scaling", YGYOTO_SPECTRUM_GENERIC_KW, 0 }; -#define nkw 2 - static long kglobs[YGYOTO_SPECTRUM_GENERIC_KW_N+nkw+1]; - int kiargs[YGYOTO_SPECTRUM_GENERIC_KW_N+nkw]; - int piargs[]={-1,-1,-1,-1}; - yarg_kw_init(const_cast(knames), kglobs, kiargs); - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - // Constructor mode from XML file - if (constructor) { - if (yarg_string(piargs[0])) { -#ifdef GYOTO_USE_XERCES - *sp_ = Factory(ygets_q(piargs[0])).getSpectrum(); - *paUsed=1; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else *sp_ = new BlackBody(); - } - SmartPointer *sp = (SmartPointer *)sp_; + YGYOTO_WORKER_INIT(Spectrum, BlackBody, + knames, YGYOTO_SPECTRUM_GENERIC_KW_N+3); - // Process specific keywords - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - - //// MEMBERS //// - /* TEMPERATURE */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*sp)->getTemperature()); - } else - (*sp)->setTemperature(ygets_d(iarg)) ; - } - - /* SCALING */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*sp)->getScaling()); - } else - (*sp)->setScaling(ygets_d(iarg)) ; - } - - - // GENERIC WORKER - ygyoto_Spectrum_generic_eval(sp_, kiargs+k+1, piargs, rvset, paUsed); + YGYOTO_WORKER_SET_UNIT; + + YGYOTO_WORKER_GETSET_DOUBLE(Temperature); + YGYOTO_WORKER_GETSET_DOUBLE(Scaling); + YGYOTO_WORKER_CALL_GENERIC(Spectrum); } @@ -114,14 +59,10 @@ void Y_gyoto_BlackBodySpectrum(int argc) { - if (debug()) cerr << "In Y_gyoto_BlackBodySpectrum" << endl; - SmartPointer *sp = NULL; - if (yarg_Spectrum(argc-1)) { - sp = yget_Spectrum(--argc); - if ((*sp)->getKind().compare("BlackBody")) - y_error("Expecting Spectrum of kind BlackBody"); - } - BlackBodyYEval(sp, argc); + YGYOTO_CONSTRUCTOR_INIT(Spectrum, BlackBody); + if ((*OBJ)->getKind().compare("BlackBody")) + y_error("Expecting Spectrum of kind BlackBody"); + BlackBodyYEval(OBJ, argc); } void Y__gyoto_BlackBodySpectrum_register_as_Metric(){ diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_Disk3D.C gyoto-0.1.0/yorick/stdplug/gyoto_Disk3D.C --- gyoto-0.0.3/yorick/stdplug/gyoto_Disk3D.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_Disk3D.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -20,7 +20,8 @@ #include #include -#include "ygyoto.h" +#include +#include "../ygyoto.h" #include "yapi.h" using namespace Gyoto; @@ -29,21 +30,13 @@ #include using namespace std; -// on_eval worker -void ygyoto_Disk3D_eval(Gyoto::SmartPointer - *ao_, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - if (!ao_) { // Constructor mode - GYOTO_DEBUG << "constructing object\n"; - ao_ = ypush_Astrobj(); - *ao_ = new Disk3D(); - } else *ypush_Astrobj()=*ao_; - - SmartPointer *ao = (SmartPointer *)ao_; +#define OBJ ao +// on_eval worker +void ygyoto_Disk3D_eval(SmartPointer *ao_, int argc) { - GYOTO_DEBUG << "processing keywords\n"; static char const * knames[]={ + "unit", "fitsread", "repeatphi", "nu0", "dnu", "rin", "rout", "zmin", "zmax", "phimin", "phimax", @@ -52,130 +45,20 @@ YGYOTO_ASTROBJ_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_ASTROBJ_GENERIC_KW_N+14]; - int kiargs[YGYOTO_ASTROBJ_GENERIC_KW_N+13]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - - /* FITSREAD */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "fitsread=\n"; - iarg+=*rvset; - (*ao)->fitsRead(ygets_q(iarg)); - } - - /* REPEATPHI */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "repeatphi=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_long((*ao)->repeatPhi()); - } else - (*ao)->repeatPhi(ygets_l(iarg)) ; - } - - /* NU0 */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "nu0=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->nu0()); - } else - (*ao)->nu0(ygets_d(iarg)) ; - } - - /* DNU */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "dnu=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->dnu()); - } else - (*ao)->dnu(ygets_d(iarg)) ; - } - - /* RIN */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "rin=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->rin()); - } else - (*ao)->rin(ygets_d(iarg)) ; - } - /* ROUT */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "rout=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->rout()); - } else - (*ao)->rout(ygets_d(iarg)) ; - } + YGYOTO_WORKER_INIT(Astrobj, Disk3D, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+14); - /* ZMIN */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "zmin=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->zmin()); - } else - (*ao)->zmin(ygets_d(iarg)) ; - } - - /* ZMAX */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "zmax=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->zmax()); - } else - (*ao)->zmax(ygets_d(iarg)) ; - } - - /* PHIMIN */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "phimin=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->phimin()); - } else - (*ao)->phimin(ygets_d(iarg)) ; - } - - /* PHIMAX */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "phimax=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->phimax()); - } else - (*ao)->phimax(ygets_d(iarg)) ; - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_RUN( fitsRead(ygets_q(iarg)) ); + YGYOTO_WORKER_GETSET_LONG2(repeatPhi); + YGYOTO_WORKER_GETSET_DOUBLE2(nu0); + YGYOTO_WORKER_GETSET_DOUBLE2(dnu); + YGYOTO_WORKER_GETSET_DOUBLE2(rin); + YGYOTO_WORKER_GETSET_DOUBLE2(rout); + YGYOTO_WORKER_GETSET_DOUBLE2(zmin); + YGYOTO_WORKER_GETSET_DOUBLE2(zmax); + YGYOTO_WORKER_GETSET_DOUBLE2(phimin); + YGYOTO_WORKER_GETSET_DOUBLE2(phimax); /* EMISSQUANT */ if ((iarg=kiargs[++k])>=0) { @@ -228,16 +111,9 @@ } } - /* FITSWRITE */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "fitswrite=\n"; - iarg+=*rvset; - (*ao)->fitsWrite(ygets_q(iarg)); - } + YGYOTO_WORKER_RUN( fitsWrite(ygets_q(iarg)) ); - GYOTO_DEBUG << "calling ygyoto_Astrobj_generic_eval\n"; - ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); - GYOTO_DEBUG << "done\n"; + YGYOTO_WORKER_CALL_GENERIC(Astrobj); } extern "C" { @@ -249,12 +125,9 @@ void Y_gyoto_Disk3D(int argc) { - SmartPointer *ao = NULL; - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - if ((*ao)->getKind().compare("Disk3D")) + YGYOTO_CONSTRUCTOR_INIT(Astrobj, Disk3D); + if ((*ao)->getKind().compare("Disk3D")) y_error("Expecting Astrobj of kind Disk3D"); - } ygyoto_Disk3D_eval(ao, argc); } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_FixedStar.C gyoto-0.1.0/yorick/stdplug/gyoto_FixedStar.C --- gyoto-0.0.3/yorick/stdplug/gyoto_FixedStar.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_FixedStar.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -18,7 +18,8 @@ */ #include -#include "ygyoto.h" +#include +#include "../ygyoto.h" #include "yapi.h" using namespace Gyoto; @@ -27,66 +28,24 @@ using namespace std; using namespace Gyoto::Astrobj; +#define OBJ ao + // on_eval worker -void ygyoto_FixedStar_eval(Gyoto::SmartPointer* ao_, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - if (!ao_) { // Constructor mode - ao_ = ypush_Astrobj(); - *ao_ = new FixedStar(); - } else *ypush_Astrobj()=*ao_; +void ygyoto_FixedStar_eval(SmartPointer* ao_, int argc) { - SmartPointer *ao = (SmartPointer *)ao_; static char const * knames[]={ - "radius", "position", + "unit", "radius", "position", YGYOTO_ASTROBJ_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_ASTROBJ_GENERIC_KW_N+3]; - int kiargs[YGYOTO_ASTROBJ_GENERIC_KW_N+2]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - /* RADIUS */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getRadius()); - } else - (*ao)->setRadius(ygets_d(iarg)) ; - } + YGYOTO_WORKER_INIT(Astrobj, FixedStar, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+3); - /* POSITION */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - long dims[] = {1, 3}; - double * data=ypush_d(dims); - (*ao)->getPos(data); - } else { - long ptot=1; - double *pos=ygeta_d(iarg, &ptot, 0); - if (ptot!=3) y_error("POS should have exactly elements"); - (*ao)->setPos(pos); - } - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Radius); + YGYOTO_WORKER_GETSET_VECTOR(Pos, 3); - // Call generic Astrobj worker - ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); + YGYOTO_WORKER_CALL_GENERIC(Astrobj); } @@ -99,12 +58,9 @@ void Y_gyoto_FixedStar(int argc) { - SmartPointer *ao = NULL; - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - if ((*ao)->getKind().compare("FixedStar")) - y_error("Expecting Astrobj of kind Star"); - } + YGYOTO_CONSTRUCTOR_INIT(Astrobj, FixedStar); + if ((*ao)->getKind().compare("FixedStar")) + y_error("Expecting Astrobj of kind Star"); ygyoto_FixedStar_eval(ao, argc); } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_Kerr.i gyoto-0.1.0/yorick/stdplug/gyoto_Kerr.i --- gyoto-0.0.3/yorick/stdplug/gyoto_Kerr.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_Kerr.i 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -plug_in, "gyoto"; -/* - Copyright 2011 Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - - -extern _gyoto_KerrBL_register_as_Metric; -_gyoto_KerrBL_register_as_Metric; -extern _gyoto_KerrKS_register_as_Metric; -_gyoto_KerrKS_register_as_Metric; -/* xDOCUMENT _gyoto_KerrBL_register_as_Metric - should be called once so that gg(get_spin=1...) works. - */ - -extern gyoto_KerrBL; -extern gyoto_KerrKS; -/* DOCUMENT gg = gyoto_KerrBL([filename,][members=values]) - or gg = gyoto_KerrKS([filename,][members=values]) - - or gg, members=values - or value = gg(member=) - - or coord = gg(makecoord=yinit, cst) // KerrBL only - - or coefs = gg(position, mu, nu) - - PURPOSE - - Instanciate and use a GYOTO KerrBL (for Kerr Boyer-Lindquist) or - Kerr (for Kerr Kerr-Schild) Metric. - - For basics, first read "help, gyoto" and "help, gyoto_Metric". - - SPECIFIC MEMBER - - In addition to the generic Metric members, KerrBL and KerrKS - metrics have a spin that can be set and retrieved as follows: - gg, spin=value; - value = gg(spin=) - - SPECIFIC METHOD - - In addition to the generic methods provided by gyoto_Metric, - KerrBL metrics provide the following: - - coord=gg(get_coord=yinit, cst) - get 8-coordinate (4-position & 4-velocity) COORD - corresponding to the 6 coordinate (4-position & 2 - momenta) YINIT and the 3 motion constants in CST. - - SEE ALSO: gyoto, gyoto_Metric - */ diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_KerrBL.C gyoto-0.1.0/yorick/stdplug/gyoto_KerrBL.C --- gyoto-0.0.3/yorick/stdplug/gyoto_KerrBL.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_KerrBL.C 2013-07-27 09:14:20.000000000 +0000 @@ -18,6 +18,7 @@ */ #include +#include #include "ygyoto.h" #include "yapi.h" @@ -27,51 +28,19 @@ using namespace Gyoto; using namespace Gyoto::Metric; -// on_eval worker -void ygyoto_KerrBL_eval(Gyoto::SmartPointer *gg_, int argc) { - if (debug()) cerr << "DEBUG: in ygyoto_KerrBL_eval()\n"; - int rvset[1]={0}, paUsed[1]={0}; - if (!gg_) { // Constructor mode - gg_ = ypush_Metric(); - *gg_ = new KerrBL(); - } else *ypush_Metric()=*gg_; +void ygyoto_KerrBL_eval(SmartPointer *OBJ_, int argc) { - SmartPointer *gg = (SmartPointer *)gg_; static char const * knames[]={ + "unit", "spin", "makecoord", \ YGYOTO_METRIC_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_METRIC_GENERIC_KW_N+4]; - int kiargs[YGYOTO_METRIC_GENERIC_KW_N+3]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Metric takes at most 4 positional arguments"); - } - } - - // Process specific keywords - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - int k=-1; - - // spin - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - yarg_drop(1); - ypush_double((*gg)->getSpin()); - } else - (*gg)->setSpin(ygets_d(iarg)) ; - } + + YGYOTO_WORKER_INIT(Metric, KerrBL, knames, YGYOTO_METRIC_GENERIC_KW_N+3); + + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_DOUBLE(Spin); if (kiargs[++k]>=0) { // makecoord if (debug()) cerr << "DEBUG: In ygyoto_KerrBL_eval(): get_coord" << endl; @@ -85,13 +54,13 @@ if (ntot!=4) y_error("CST should have 4 elements"); yarg_drop(1); double * coord=ypush_d(dims); - (*gg)->MakeCoord(coord_,cst_,coord); +# ifdef GYOTO_DEBUG_ENABLED + GYOTO_DEBUG_EXPR(OBJ); +# endif + (*OBJ)->MakeCoord(coord_,cst_,coord); } - - ygyoto_Metric_generic_eval(gg_, kiargs+k+1, piargs, rvset, paUsed); - - if (debug()) cerr << "DEBUG: ygyoto_KerrBL_eval() done\n"; + YGYOTO_WORKER_CALL_GENERIC(Metric); } @@ -100,24 +69,13 @@ ygyoto_Metric_register("KerrBL",&ygyoto_KerrBL_eval); } - // KERR CLASS - // Constructor - void Y_gyoto_KerrBL(int argc) { - SmartPointer *gg = NULL; - try { - // char *obj_type=(char*)yget_obj(argc-1,0); - // if (obj_type && //!strcmp(obj_type, "gyoto_Metric")) { - // if (yget_obj(argc-1,0) && yarg_typeid(argc-1)==Y_OPAQUE) { - if (yarg_Metric(argc-1)) { - gg = yget_Metric(--argc); - if ((*gg)->getKind() != "KerrBL") - y_error("Expecting Metric of kind KerrBL"); - } - } YGYOTO_STD_CATCH; - ygyoto_KerrBL_eval(gg, argc); + YGYOTO_CONSTRUCTOR_INIT(Metric, KerrBL); + if ((*OBJ)->getKind() != "KerrBL") + y_error("Expecting Metric of kind KerrBL"); + ygyoto_KerrBL_eval(OBJ, argc); } } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_KerrKS.C gyoto-0.1.0/yorick/stdplug/gyoto_KerrKS.C --- gyoto-0.0.3/yorick/stdplug/gyoto_KerrKS.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_KerrKS.C 2013-07-27 09:14:20.000000000 +0000 @@ -18,6 +18,7 @@ */ #include +#include #include "ygyoto.h" #include "yapi.h" @@ -27,52 +28,22 @@ using namespace Gyoto; using namespace Gyoto::Metric; -// on_eval worker -void ygyoto_KerrKS_eval(Gyoto::SmartPointer *gg_, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - if (!gg_) { // Constructor mode - gg_ = ypush_Metric(); - *gg_ = new KerrKS(); - } else *ypush_Metric()=*gg_; +#define OBJ gg + +void ygyoto_KerrKS_eval(SmartPointer *gg_, int argc) { - SmartPointer *gg = (SmartPointer *)gg_; static char const * knames[]={ - "spin", + "unit", "spin", YGYOTO_METRIC_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_METRIC_GENERIC_KW_N+3]; - int kiargs[YGYOTO_METRIC_GENERIC_KW_N+2]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Metric takes at most 4 positional arguments"); - } - } - - // Process specific GET keywords - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - int k=-1; - - // SPIN - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - yarg_drop(1); - ypush_double((*gg)->getSpin()); - } else - (*gg)->setSpin(ygets_d(iarg)) ; - } - ygyoto_Metric_generic_eval(gg_, kiargs+k+1, piargs, rvset, paUsed); + YGYOTO_WORKER_INIT(Metric, KerrKS, knames, YGYOTO_METRIC_GENERIC_KW_N+2); + + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_DOUBLE(Spin); + + YGYOTO_WORKER_CALL_GENERIC(Metric); } @@ -82,20 +53,12 @@ ygyoto_Metric_register("KerrKS",&ygyoto_KerrKS_eval); } - // KERR CLASS - // Constructor - void Y_gyoto_KerrKS(int argc) { - SmartPointer *gg = NULL; - try { - if (yarg_Metric(argc-1)) { - gg = yget_Metric(--argc); - if ((*gg)->getKind() != "KerrKS") - y_error("Expecting Metric of kind KerrKS"); - } - } YGYOTO_STD_CATCH; + YGYOTO_CONSTRUCTOR_INIT(Metric, KerrKS); + if ((*OBJ)->getKind() != "KerrKS") + y_error("Expecting Metric of kind KerrKS"); ygyoto_KerrKS_eval(gg, argc); } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_PageThorneDisk.C gyoto-0.1.0/yorick/stdplug/gyoto_PageThorneDisk.C --- gyoto-0.0.3/yorick/stdplug/gyoto_PageThorneDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_PageThorneDisk.C 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/* - Copyright 2011 Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - -#include -#include "ygyoto.h" -#include "yapi.h" - -using namespace Gyoto; -using namespace Gyoto::Astrobj; - -#include -using namespace std; - -// on_eval worker -void ygyoto_PageThorneDisk_eval(Gyoto::SmartPointer - *ao_, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - if (!ao_) { // Constructor mode - ao_ = ypush_Astrobj(); - *ao_ = new PageThorneDisk(); - } else *ypush_Astrobj()=*ao_; - - SmartPointer *ao = (SmartPointer *)ao_; - - static char const * knames[]={ - "updatespin", - YGYOTO_THINDISK_GENERIC_KW, - 0 - }; - static long kglobs[YGYOTO_THINDISK_GENERIC_KW_N+2]; - int kiargs[YGYOTO_THINDISK_GENERIC_KW_N+1]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - // Call generic ThinDisk worker - - /* UPDATESPIN */ - if ((iarg=kiargs[++k])>=0) (*ao) -> updateSpin(); - - ygyoto_ThinDisk_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); -} - -extern "C" { - void Y__gyoto_PageThorneDisk_register_as_Astrobj(){ - ygyoto_Astrobj_register("PageThorneDisk",&ygyoto_PageThorneDisk_eval); - } - - // Generic constructor/accessor - void - Y_gyoto_PageThorneDisk(int argc) - { - SmartPointer *ao = NULL; - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - if ((*ao)->getKind().compare("PageThorneDisk")) - y_error("Expecting Astrobj of kind PageThorneDisk"); - } - ygyoto_PageThorneDisk_eval(ao, argc); - } - -} diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_PatternDisk.C gyoto-0.1.0/yorick/stdplug/gyoto_PatternDisk.C --- gyoto-0.0.3/yorick/stdplug/gyoto_PatternDisk.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_PatternDisk.C 2013-07-27 09:14:20.000000000 +0000 @@ -20,8 +20,9 @@ #include #include -#include "ygyoto.h" +#include "../ygyoto.h" #include "yapi.h" +#include using namespace Gyoto; using namespace Gyoto::Astrobj; @@ -30,20 +31,10 @@ using namespace std; // on_eval worker -void ygyoto_PatternDisk_eval(Gyoto::SmartPointer - *ao_, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - if (!ao_) { // Constructor mode - GYOTO_DEBUG << "constructing object\n"; - ao_ = ypush_Astrobj(); - *ao_ = new PatternDisk(); - } else *ypush_Astrobj()=*ao_; +void ygyoto_PatternDisk_eval(SmartPointer *OBJ_, int argc) { - SmartPointer *ao = (SmartPointer *)ao_; - - - GYOTO_DEBUG << "processing keywords\n"; static char const * knames[]={ + "unit", "fitsread", "patternvelocity", "repeatphi", "nu0", "dnu", "phimin", "phimax", "copyintensity", "copyopacity", "copyvelocity", "copygridradius", @@ -51,97 +42,18 @@ YGYOTO_THINDISK_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_THINDISK_GENERIC_KW_N+13]; - int kiargs[YGYOTO_THINDISK_GENERIC_KW_N+12]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - // Call generic ThinDisk worker - - /* FITSREAD */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "fitsread=\n"; - iarg+=*rvset; - (*ao)->fitsRead(ygets_q(iarg)); - } - /* PATTERNVELOCITY */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getPatternVelocity()); - } else - (*ao)->setPatternVelocity(ygets_d(iarg)) ; - } + YGYOTO_WORKER_INIT(Astrobj, PatternDisk, knames, + YGYOTO_THINDISK_GENERIC_KW_N+13); - /* REPEATPHI */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "repeatphi=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_long((*ao)->repeatPhi()); - } else - (*ao)->repeatPhi(ygets_l(iarg)) ; - } - - /* NU0 */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "nu0=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->nu0()); - } else - (*ao)->nu0(ygets_d(iarg)) ; - } - - /* DNU */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "dnu=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->dnu()); - } else - (*ao)->dnu(ygets_d(iarg)) ; - } - - /* PHIMIN */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "phimin=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->phimin()); - } else - (*ao)->phimin(ygets_d(iarg)) ; - } - - /* PHIMAX */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "phimax=\n"; - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->phimax()); - } else - (*ao)->phimax(ygets_d(iarg)) ; - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_RUN( fitsRead(ygets_q(iarg)) ); + YGYOTO_WORKER_GETSET_DOUBLE(PatternVelocity); + YGYOTO_WORKER_GETSET_LONG2(repeatPhi); + YGYOTO_WORKER_GETSET_DOUBLE2(nu0); + YGYOTO_WORKER_GETSET_DOUBLE2(dnu); + YGYOTO_WORKER_GETSET_DOUBLE2(phimin); + YGYOTO_WORKER_GETSET_DOUBLE2(phimax); /* INTENSITY */ if ((iarg=kiargs[++k])>=0) { @@ -150,19 +62,19 @@ if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[3]; - (*ao) -> getIntensityNaxes(ddims); + (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {3, ddims[0], ddims[1], ddims[2]}; double * out = ypush_d(dims); - memcpy(out, (*ao)->getIntensity(), + memcpy(out, (*OBJ)->getIntensity(), dims[1]*dims[2]*dims[3]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); - if (dims[0]==0 && ntot && *in==0) (*ao) -> copyIntensity(NULL, 0); + if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyIntensity(NULL, 0); else if (dims[0]==3) { size_t ddims[] = {dims[1], dims[2], dims[3]}; - (*ao)->copyIntensity(in, ddims); + (*OBJ)->copyIntensity(in, ddims); } else y_error("COPYINTENSITY must be nil, 0, or array(double, nnu, nphi, nr"); } @@ -175,19 +87,19 @@ if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[3]; - (*ao) -> getIntensityNaxes(ddims); + (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {3, ddims[0], ddims[1], ddims[2]}; double * out = ypush_d(dims); - memcpy(out, (*ao)->getOpacity(), + memcpy(out, (*OBJ)->getOpacity(), dims[1]*dims[2]*dims[3]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); - if (dims[0]==0 && ntot && *in==0) (*ao) -> copyOpacity(NULL, 0); + if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyOpacity(NULL, 0); else if (dims[0]==3) { size_t ddims[] = {dims[1], dims[2], dims[3]}; - (*ao)->copyOpacity(in, ddims); + (*OBJ)->copyOpacity(in, ddims); } else y_error("COPYOPACITY must be nil, 0, or array(double, nnu, nphi, nr"); } @@ -199,19 +111,19 @@ if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); size_t ddims[3]; - (*ao) -> getIntensityNaxes(ddims); + (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {3, 2, ddims[1], ddims[2]}; double * out = ypush_d(dims); - memcpy(out, (*ao)->getVelocity(), + memcpy(out, (*OBJ)->getVelocity(), 2*dims[2]*dims[3]*sizeof(double)); } else { long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); - if (dims[0]==0 && ntot && *in==0) (*ao) -> copyVelocity(NULL, 0); + if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyVelocity(NULL, 0); else if (dims[0]==3 && dims[1]==2) { size_t ddims[] = {dims[2], dims[3]}; - (*ao)->copyVelocity(in, ddims); + (*OBJ)->copyVelocity(in, ddims); } else y_error("COPYVELOCITY must be nil, 0, or array(double, 2, nphi, nr"); } @@ -223,10 +135,10 @@ iarg+=*rvset; if (yarg_nil(iarg)) { if ((*rvset)++) y_error(rmsg); - double const * const radius = (*ao)->getGridRadius(); + double const * const radius = (*OBJ)->getGridRadius(); if (radius) { size_t ddims[3]; - (*ao) -> getIntensityNaxes(ddims); + (*OBJ) -> getIntensityNaxes(ddims); long dims[] = {1, ddims[2]}; double * out = ypush_d(dims); memcpy(out, radius, ddims[2]*sizeof(double)); @@ -235,22 +147,15 @@ long ntot; long dims[Y_DIMSIZE]; double const * const in = ygeta_d(iarg, &ntot, dims); - if (dims[0]==0 && ntot && *in==0) (*ao) -> copyGridRadius(NULL, 0); - else if (dims[0]==1) (*ao) -> copyGridRadius(in, ntot); + if (dims[0]==0 && ntot && *in==0) (*OBJ) -> copyGridRadius(NULL, 0); + else if (dims[0]==1) (*OBJ) -> copyGridRadius(in, ntot); else y_error("COPYGRIDRADIUS must be nil, 0, or array(double, nr"); } } - /* FITSWRITE */ - if ((iarg=kiargs[++k])>=0) { - GYOTO_DEBUG << "fitswrite=\n"; - iarg+=*rvset; - (*ao)->fitsWrite(ygets_q(iarg)); - } + YGYOTO_WORKER_RUN( fitsWrite(ygets_q(iarg)) ); - GYOTO_DEBUG << "calling ygyoto_ThinDisk_generic_eval\n"; - ygyoto_ThinDisk_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); - GYOTO_DEBUG << "done\n"; + YGYOTO_WORKER_CALL_GENERIC(ThinDisk); } extern "C" { @@ -262,13 +167,10 @@ void Y_gyoto_PatternDisk(int argc) { - SmartPointer *ao = NULL; - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - if ((*ao)->getKind().compare("PatternDisk")) - y_error("Expecting Astrobj of kind PatternDisk"); - } - ygyoto_PatternDisk_eval(ao, argc); + YGYOTO_CONSTRUCTOR_INIT(Astrobj, PatternDisk); + if ((*OBJ)->getKind().compare("PatternDisk")) + y_error("Expecting Astrobj of kind PatternDisk"); + ygyoto_PatternDisk_eval(OBJ, argc); } } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_PolishDoughnut.C gyoto-0.1.0/yorick/stdplug/gyoto_PolishDoughnut.C --- gyoto-0.0.3/yorick/stdplug/gyoto_PolishDoughnut.C 1970-01-01 00:00:00.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_PolishDoughnut.C 2013-07-27 09:14:20.000000000 +0000 @@ -0,0 +1,80 @@ +/* + Copyright (c) 2012-2013 Thibaut Paumard + + This file is part of Gyoto. + + Gyoto is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gyoto is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Gyoto. If not, see . + */ + +#include "../ygyoto.h" +#include "yapi.h" +#include +#ifdef GYOTO_USE_XERCES +#include +#endif + +#include +using namespace std; + +using namespace Gyoto; +using namespace Gyoto::Astrobj; + +// on_eval worker +void ygyoto_PolishDoughnut_eval(SmartPointer* OBJ_, int argc) { + + static char const * knames[]={ + "unit", + "lambda", "tempratio", "centraldensity", "centraltempovervirial", "beta", + "spectraloversampling", + "l0", "Wsurface", "Wcentre", "rcusp", "rcentre", + YGYOTO_ASTROBJ_GENERIC_KW, + 0 + }; + + YGYOTO_WORKER_INIT(Astrobj, PolishDoughnut, knames, + YGYOTO_ASTROBJ_GENERIC_KW_N+12); + + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_DOUBLE(Lambda); + YGYOTO_WORKER_GETSET_DOUBLE(TemperatureRatio); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(CentralDensity); + YGYOTO_WORKER_GETSET_DOUBLE(CentralTempOverVirial); + YGYOTO_WORKER_GETSET_DOUBLE(Beta); + YGYOTO_WORKER_GETSET_LONG(SpectralOversampling); + YGYOTO_WORKER_GET_DOUBLE(getL0); + YGYOTO_WORKER_GET_DOUBLE(getWsurface); + YGYOTO_WORKER_GET_DOUBLE(getWcentre); + YGYOTO_WORKER_GET_DOUBLE(getRcusp); + YGYOTO_WORKER_GET_DOUBLE(getRcentre); + + YGYOTO_WORKER_CALL_GENERIC(Astrobj); +} + + +extern "C" { + void Y__gyoto_PolishDoughnut_register_as_Astrobj(){ + ygyoto_Astrobj_register("PolishDoughnut",&ygyoto_PolishDoughnut_eval); + } + + // Generic constructor/accessor + void + Y_gyoto_PolishDoughnut(int argc) + { + YGYOTO_CONSTRUCTOR_INIT(Astrobj, PolishDoughnut); + if ((*OBJ)->getKind()!="PolishDoughnut") + y_error("Expecting Astrobj of kind PolishDoughnut"); + ygyoto_PolishDoughnut_eval(OBJ, argc); + } + +} diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_PowerLawSpectrum.C gyoto-0.1.0/yorick/stdplug/gyoto_PowerLawSpectrum.C --- gyoto-0.0.3/yorick/stdplug/gyoto_PowerLawSpectrum.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_PowerLawSpectrum.C 2013-07-27 09:14:20.000000000 +0000 @@ -35,78 +35,24 @@ using namespace YGyoto::Spectrum; using namespace std; -void YGyoto::Spectrum::PowerLawYEval(SmartPointer * sp_, int argc) { - if (debug()) cerr << "in PowerLawYEval()" << endl; - int rvset[1]={0}, paUsed[1]={0}, constructor=0; - - // If needed, create the object. - if (!sp_) { // Constructor mode - constructor=1; - sp_ = ypush_Spectrum(); - } else *ypush_Spectrum()=*sp_; +void YGyoto::Spectrum::PowerLawYEval(SmartPointer * OBJ_, int argc) { - // Parse arguments static char const * knames[]={ + "unit", "constant", "exponent", YGYOTO_SPECTRUM_GENERIC_KW, 0 }; -#define nkw 2 - static long kglobs[YGYOTO_SPECTRUM_GENERIC_KW_N+nkw+1]; - int kiargs[YGYOTO_SPECTRUM_GENERIC_KW_N+nkw]; - int piargs[]={-1,-1,-1,-1}; - yarg_kw_init(const_cast(knames), kglobs, kiargs); - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - // Constructor mode from XML file - if (constructor) { - if (yarg_string(piargs[0])) { -#ifdef GYOTO_USE_XERCES - *sp_ = Factory(ygets_q(piargs[0])).getSpectrum(); - *paUsed=1; -#else - y_error("This GYOTO was compiled without XERCES: no xml i/o"); -#endif - } else *sp_ = new PowerLaw(); - } - SmartPointer *sp = (SmartPointer *)sp_; + YGYOTO_WORKER_INIT(Spectrum, PowerLaw, + knames, YGYOTO_SPECTRUM_GENERIC_KW_N+3); - // Process specific keywords - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - - //// MEMBERS //// - /* CONSTANT */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*sp)->getConstant()); - } else - (*sp)->setConstant(ygets_d(iarg)) ; - } - - /* EXPONENT */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*sp)->getExponent()); - } else - (*sp)->setExponent(ygets_d(iarg)) ; - } - + YGYOTO_WORKER_SET_UNIT; + + YGYOTO_WORKER_GETSET_DOUBLE(Constant); + YGYOTO_WORKER_GETSET_DOUBLE(Exponent); - // GENERIC WORKER - ygyoto_Spectrum_generic_eval(sp_, kiargs+k+1, piargs, rvset, paUsed); + YGYOTO_WORKER_CALL_GENERIC(Spectrum); } @@ -114,14 +60,10 @@ void Y_gyoto_PowerLawSpectrum(int argc) { - if (debug()) cerr << "In Y_gyoto_PowerLawSpectrum" << endl; - SmartPointer *sp = NULL; - if (yarg_Spectrum(argc-1)) { - sp = yget_Spectrum(--argc); - if ((*sp)->getKind().compare("PowerLaw")) - y_error("Expecting Spectrum of kind PowerLaw"); - } - PowerLawYEval(sp, argc); + YGYOTO_CONSTRUCTOR_INIT(Spectrum, PowerLaw); + if ((*OBJ)->getKind().compare("PowerLaw")) + y_error("Expecting Spectrum of kind PowerLaw"); + PowerLawYEval(OBJ, argc); } void Y__gyoto_PowerLawSpectrum_register_as_Metric(){ diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_Star.C gyoto-0.1.0/yorick/stdplug/gyoto_Star.C --- gyoto-0.0.3/yorick/stdplug/gyoto_Star.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_Star.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -17,7 +17,7 @@ along with Gyoto. If not, see . */ -#include "ygyoto.h" +#include "../ygyoto.h" #include "yapi.h" #include #ifdef GYOTO_USE_XERCES @@ -25,92 +25,33 @@ #endif #include +#include using namespace std; using namespace Gyoto; using namespace Gyoto::Astrobj; +#define OBJ ao + // on_eval worker -void ygyoto_Star_eval(Gyoto::SmartPointer* ao_, int argc) { - if (debug()) cerr << "in ygyoto_Star_eval" << endl; - int rvset[1]={0}, paUsed[1]={0}, constructor=0; - - // If needed, create the object. - if (!ao_) { // Constructor mode - constructor=1; - ao_ = ypush_Astrobj(); - } else *ypush_Astrobj()=*ao_; +void ygyoto_Star_eval(SmartPointer* ao_, int argc) { + GYOTO_DEBUG << endl; - // Parse arguments + // Define keywords static char const * knames[]={ - "radius", "metric", "initcoord", "spectrum", "opacity", "reset", "xfill", + "unit", + "radius", "metric", "initcoord", "spectrum", "opacity", "delta", "adaptive", + "maxiter", "reset", "xfill", YGYOTO_ASTROBJ_GENERIC_KW, - "get_skypos", "get_txyz", "get_coord", "get_cartesian", + "get_skypos", "get_txyz", "get_prime", "get_coord", "get_cartesian", 0 }; -#define nkw 11 - static long kglobs[YGYOTO_ASTROBJ_GENERIC_KW_N+nkw+1]; - int kiargs[YGYOTO_ASTROBJ_GENERIC_KW_N+nkw]; - int piargs[]={-1,-1,-1,-1}; - yarg_kw_init(const_cast(knames), kglobs, kiargs); - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - if (debug()) { - cerr << "DEBUG: gyoto_Star parameters:" << endl; - for (int i=0; i<4; ++i) - cerr << "DEBUG: piargs[" << i << "]=" - << piargs[i] << endl; - for (int i=0; i *ao = (SmartPointer *)ao_; + YGYOTO_WORKER_INIT(Astrobj, Star, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+16); - // Process specific keywords - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - - //// MEMBERS //// - /* RADIUS */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getRadius()); - } else - (*ao)->setRadius(ygets_d(iarg)) ; - } - - /* METRIC */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - *ypush_Metric() = (*ao)->getMetric(); - } else - (*ao)->setMetric(*yget_Metric(iarg)) ; - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Radius); + YGYOTO_WORKER_GETSET_OBJECT(Metric); /* INITCOORD */ if ((iarg=kiargs[++k])>=0) { //initcoord @@ -152,32 +93,19 @@ } } - /* SPECTRUM */ - if ((iarg=kiargs[++k])>=0) { - if (yarg_nil(iarg)) { - SmartPointer * sp = ypush_Spectrum(); - *sp = (*ao) -> getSpectrum(); - } else { - (*ao) -> setSpectrum ( *yget_Spectrum(iarg) ); - } - } - - /* OPACITY */ - if ((iarg=kiargs[++k])>=0) { - if (yarg_nil(iarg)) { - SmartPointer * sp = ypush_Spectrum(); - *sp = (*ao) -> getOpacity(); - } else { - (*ao) -> setOpacity ( *yget_Spectrum(iarg) ); - } - } - - //// METHODS //// - if ((iarg=kiargs[++k])>=0) (*ao)->reset(); - if ((iarg=kiargs[++k])>=0) (*ao)->xFill(ygets_d(iarg+*rvset)); + YGYOTO_WORKER_GETSET_OBJECT(Spectrum); +#define ypush_Opacity ypush_Spectrum +#define yget_Opacity yget_Spectrum + YGYOTO_WORKER_GETSET_OBJECT(Opacity); +#undef ypush_Opacity +#undef yget_Opacity + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Delta); + YGYOTO_WORKER_GETSET_LONG2(adaptive); + YGYOTO_WORKER_GETSET_LONG2( maxiter ); + YGYOTO_WORKER_RUN( reset() ); + YGYOTO_WORKER_RUN( xFill(ygets_d(iarg+*rvset)) ); - // GENERIC WORKER - ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); + YGYOTO_WORKER_CALL_GENERIC(Astrobj); k += YGYOTO_ASTROBJ_GENERIC_KW_N; @@ -196,7 +124,7 @@ (*ao)->getSkyPos(*screen, data, data+nel, data+2*nel); } - if (yarg_true(kiargs[++k])) { // get_txyz + if ((iarg=kiargs[++k])>=0) { // get_txyz if ((*rvset)++) y_error(rmsg); int nel =(*ao)->get_nelements(); @@ -207,6 +135,16 @@ (*ao)->get_xyz(data+nel, data+2*nel, data+3*nel); } + if ((iarg=kiargs[++k])>=0) { // get_prime + if ((*rvset)++) y_error(rmsg); + int nel =(*ao)->get_nelements(); + + long dims[] = {2, nel, 3}; + double * data=ypush_d(dims); + + (*ao)->get_prime(data, data+nel, data+2*nel); + } + if ((iarg=kiargs[++k])>=0) { // get_coord if ((*rvset)++) y_error(rmsg); // Two cases : get_coord=1 or get_coord=dates. @@ -216,11 +154,19 @@ int argt = yarg_number(iarg); long ntot[1] = {1}; long dims[Y_DIMSIZE]; - double* dates = ygeta_d(iarg, ntot, dims); + double* dates = NULL; + double dummy[]= {1.}; + if (yarg_nil(iarg)) { + // void is same as 1 in this context + argt=1; + *ntot=1; + dims[0]=0; + dates=dummy; + } else dates = ygeta_d(iarg, ntot, dims); if (debug()) cerr << "DEBUG: gyoto_Star(get_coord=array(" - << (yarg_number(iarg)==1?"long":"double") + << (argt==1?"long":"double") << ", " << *ntot << ") (rank=" << dims[0] << ", dates[0]=" << dates[0] << ")" << endl; @@ -283,221 +229,11 @@ void Y_gyoto_Star(int argc) { - if (debug()) cerr << "In Y_gyoto_Star" << endl; - SmartPointer *ao = NULL; - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - if ((*ao)->getKind().compare("Star")) - y_error("Expecting Astrobj of kind Star"); - } + GYOTO_DEBUG << endl; + YGYOTO_CONSTRUCTOR_INIT(Astrobj, Star); + if ((*ao)->getKind().compare("Star")) + y_error("Expecting Astrobj of kind Star"); ygyoto_Star_eval(ao, argc); } - // STAR CLASS - void - Y_gyoto_Star_get_t(int n) - { - if (n!=1) y_error("gyoto_Star_get_t takes exactly 1 argument"); - SmartPointer *astrobj=yget_Astrobj(0); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - SmartPointer st (*astrobj); - int nel ; - try { nel = st->get_nelements(); } - YGYOTO_STD_CATCH ; - long dims[] = {1, nel}; - double * t=ypush_d(dims); - try { st->get_t(t); } - YGYOTO_STD_CATCH ; - } - - void - Y_gyoto_Star_xFill(int n) - { - if (n!=2) y_error("gyoto_Star_xFill takes exactly 2 argument"); - SmartPointer *astrobj=yget_Astrobj(n-1); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - double tlim=ygets_d(n-2); - SmartPointer st (*astrobj); - try { st->xFill(tlim); } - YGYOTO_STD_CATCH ; - } - - void - Y_gyoto_Star_getSkyPos(int n) - { - if (n<2) y_error("gyoto_Star_get_xyz takes at least 3 argument"); - if (n>4) y_error("gyoto_Star_get_xyz takes at most 5 arguments"); - SmartPointer *astrobj=yget_Astrobj(n-1); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - - SmartPointer *screen = yget_Screen(n-2); - - long da_ref=yget_ref(n-3); - long dd_ref=yget_ref(n-4); - long dD_ref=yget_ref(n-5); - - SmartPointer st (*astrobj); - int nel ; - try { nel = st->get_nelements(); } - YGYOTO_STD_CATCH ; - long dims[] = {1, nel}; - double * da=ypush_d(dims); - double * dd=ypush_d(dims); - double * dD=ypush_d(dims); - - try { st->getSkyPos(*screen, da, dd, dD); } - YGYOTO_STD_CATCH ; - - yput_global(dD_ref,0); - yarg_drop(1); - yput_global(dd_ref,0); - yarg_drop(1); - yput_global(da_ref,0); - - } - - void - Y_gyoto_Star_get_xyz(int n) - { - if (n<2) y_error("gyoto_Star_get_xyz takes at least 2 argument"); - if (n>4) y_error("gyoto_Star_get_xyz takes at most 4 arguments"); - SmartPointer *astrobj=yget_Astrobj(n-1); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - long x_ref=yget_ref(n-2); - long y_ref=yget_ref(n-3); - long z_ref=yget_ref(n-4); - - SmartPointer st (*astrobj); - int nel ; - try { nel = st->get_nelements(); } - YGYOTO_STD_CATCH ; - long dims[] = {1, nel}; - double * x=ypush_d(dims); - double * y=ypush_d(dims); - double * z=ypush_d(dims); - - try { st->get_xyz(x,y,z); } - YGYOTO_STD_CATCH ; - - yput_global(z_ref,0); - yarg_drop(1); - yput_global(y_ref,0); - yarg_drop(1); - yput_global(x_ref,0); - - } - - void - Y_gyoto_Star_get_coord(int n) - { - if (n<2) y_error("gyoto_Star_get_coord takes at least 2 argument"); - if (n>5) y_error("gyoto_Star_get_coord takes at most 5 arguments"); - SmartPointer *astrobj=yget_Astrobj(n-1); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - long x0_ref=yget_ref(n-2); - long x1_ref=yget_ref(n-3); - long x2_ref=yget_ref(n-4); - long x3_ref=yget_ref(n-5); - - SmartPointer st (*astrobj); - int nel ; - try { nel = st->get_nelements(); } - YGYOTO_STD_CATCH ; - long dims[] = {1, nel}; - double * x0=ypush_d(dims); - double * x1=ypush_d(dims); - double * x2=ypush_d(dims); - double * x3=ypush_d(dims); - - try { st->getCoord(x0, x1, x2, x3); } - YGYOTO_STD_CATCH ; - - yput_global(x3_ref,0); - yarg_drop(1); - yput_global(x2_ref,0); - yarg_drop(1); - yput_global(x1_ref,0); - yarg_drop(1); - yput_global(x0_ref,0); - - } - - void - Y_gyoto_Star_get_dot(int n) - { - if (n<2) y_error("gyoto_Star_get_dot takes at least 2 argument"); - if (n>5) y_error("gyoto_Star_get_dot takes at most 5 arguments"); - SmartPointer *astrobj=yget_Astrobj(n-1); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - long x0_ref=yget_ref(n-2); - long x1_ref=yget_ref(n-3); - long x2_ref=yget_ref(n-4); - long x3_ref=yget_ref(n-5); - - SmartPointer st (*astrobj); - int nel ; - try { nel = st->get_nelements(); } - YGYOTO_STD_CATCH ; - long dims[] = {1, nel}; - double * x0=ypush_d(dims); - double * x1=ypush_d(dims); - double * x2=ypush_d(dims); - double * x3=ypush_d(dims); - - try { st->get_dot(x0, x1, x2, x3); } - YGYOTO_STD_CATCH ; - - yput_global(x3_ref,0); - yarg_drop(1); - yput_global(x2_ref,0); - yarg_drop(1); - yput_global(x1_ref,0); - yarg_drop(1); - yput_global(x0_ref,0); - } - - void - Y_gyoto_Star_get_prime(int n) - { - if (n<2) y_error("gyoto_Star_get_prime takes at least 2 argument"); - if (n>4) y_error("gyoto_Star_get_prime takes at most 4 arguments"); - SmartPointer *astrobj=yget_Astrobj(n-1); - if (strcmp((*astrobj)->getKind().c_str(),"Star")) y_error("first argument must be a GYOTO Star object "); - long x1_ref=yget_ref(n-2); - long x2_ref=yget_ref(n-3); - long x3_ref=yget_ref(n-4); - - SmartPointer st (*astrobj); - int nel ; - try { nel = st->get_nelements(); } - YGYOTO_STD_CATCH ; - long dims[] = {1, nel}; - double * x1=ypush_d(dims); - double * x2=ypush_d(dims); - double * x3=ypush_d(dims); - - try { st->get_prime(x1, x2, x3); } - YGYOTO_STD_CATCH ; - - yput_global(x3_ref,0); - yarg_drop(1); - yput_global(x2_ref,0); - yarg_drop(1); - yput_global(x1_ref,0); - - } - - void - Y_is_gyoto_Star(int argc) - { - if (!yarg_Astrobj(0)) { - ypush_long(0); - return; - } - SmartPointer *ao = yget_Astrobj(0); - ypush_long((*ao)->getKind() == "Star"); - } - - - } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_Star.i gyoto-0.1.0/yorick/stdplug/gyoto_Star.i --- gyoto-0.0.3/yorick/stdplug/gyoto_Star.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_Star.i 1970-01-01 00:00:00.000000000 +0000 @@ -1,229 +0,0 @@ -plug_in, "gyoto"; -/* - Copyright 2011 Thibaut Paumard - - This file is part of Gyoto. - - Gyoto is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Gyoto is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Gyoto. If not, see . - */ - - -extern _gyoto_Star_register_as_Astrobj; -_gyoto_Star_register_as_Astrobj -/* xDOCUMENT _gyoto_Star_register_as_Astrobj - To be called exactly once ins gyoto_Star.i -*/ - -extern gyoto_Star; -/* DOCUMENT st = gyoto_Star([filename, ][members=values]) - - or st, [members=values] - or value = st(member=) - - or st, xfill=tlim; - or data = st(function_method=parameters) - - PURPOSE: - - Create and manipulate GYOTO Star objects. Stars are a specific - kind of Gyoto Astrobj which move in the metric following - time-like geodesics and are sort of spherical (although what - "spherical" means is coordinate-system-dependent and purely - geometrical). - - There are two uses for GYOTO Stars: - - for computing the trajectory of a massive particle in the metric; - - as the light source for ray-tracing. - - For basic concepts, see gyoto and gyoto_Astrobj. - - - MEMBERS: - - In addition to the generic members described in gyoto_Astrobj, - Stars have the following members (which can be set with "st, - member=value" and retrieved with "value=st(member=)"): - radius= the radius of the sperical star, in geometrical units; - metric= the metric of which the Stars follows the geodesics; - initcoord=[x0, x1, x2, x3], [dx1/dx0, dx2/dx0, dx3/dx0] - or initcoord=[x0, x1, x2, x3, dx1/dx0, dx2/dx0, dx3/dx0] - or initcoord=[x0, x1, x2, x3, x0dot, x1dot, x2dot, x3dot] - initial position of velocity, requires metric to have - been set previously; - - METHODS - - In addition to the generic Astrobj methods, stars provide the - following: - - Subroutine-like (st, subroutine_keyword=parameters): - reset=anything (e.g.: st, reset=; ) - Forget the result of a previous integration (see XFILL - below). - - xfill=tlim - The orbit is computed between x0 (in INITCOORD) and - tlim. XFILL requires INITIALCOOORD to have been - set. It is not guaranteed that any of the computed dates - is actually tlim, merely that the orbit is computed a - least from T0 to TLIM. - - The result of the integretation is cached inside the - star object and can be retrieved with the various get_* - methods below. Beware that changing a parameter in the - metric will ne be taken into account in the retrieved - results. To start again the integration, do one of the - following: - st, metric=new_metric; - st, initcoord=conditions; - st, reset=; - - - Function-like (retval=st(function_method=parameters)): - - The following return the position of the star for all the dates - that where evaluated by the integrated when XFILL, above, was - called, in various coordinate systems: - get_skypos=screen - Retrieve RA, Dec and depth - data = st(get_skypos=screen); - da=data(,1), dd=data(,2), dD=data(,3); - SCREEN is a gyoto_Screen; - - da, dd and dD are the offsets from the center of the - Metric in RA, Dec and along the line-of-sight. - - get_txyz=anything - Retrieve Cartesian coordinates - data = st(get_txyz=); - t=data(,1), x=data(,2), y=data(,3), z=data(,4); - ANYTHING can be anything, including nil. - - get_coord=1 - Retrieve 8-coordinates (in Metric-prefered coord system) - data = st(get_coord=1); - data(i, )=[t_i, x1_i, x2_i, x3_i, - x0dot_i, x1dot_i, x2dot_i, x3dot_i] - - The following retrieve coordinates for specific dates. There is - some interpolation involved which is done rather - precisely. DATES is a scalar double or an array of doubles of - any shape. All the output sub-arrays DATA(..,i) are conformable - with DATES: - - get_coord=dates Retrieve 7 coordinates: - data = star (get_coord=dates); - STAR is a Star and DATES is an array of double with N - elements. DATA will be an array of Nx7 elements where - each of the 7 subarrays DATA(,i) is conformable with - DATES. In the following, i is the index in the usual - physical notation (X0 = time): - X0 = DATES - for i in {1, 2, 3}, Xi = DATA(..,i); - for i in {0, 1, 2, 3} Xidot = DATA(..,i+4). - - get_cartesian=dates Retrieve 6-coordinates: - data = star (get_cartesian=dates); - STAR is a Star and DATES is an array of double with N - elements. DATA will be an array of Nx6 elements where - each of the 7 subarrays DATA(,i) is conformable with - DATES. - X = DATA(..,1); Y = DATA(..,2); Z = DATA(..,3); - dX/dt = DATA(..,4); dY/dt = DATA(..,5); dZ/dt = DATA(..,6); - - EXAMPLE: - data = gyoto_Star(get_txyz=1, initialpos=pos, v, xfill=tlim, - metric=gyoto_KerrBL(spin=a)); - - SEE ALSO: gyoto_Metric, gyoto_Kerr - */ - - -extern gyoto_Star_xFill; -/* DOCUMENT gyoto_Star_xFill, st, tlim - or st, xfill=tlim - - Integrate Star orbit from previously set initial condition to tlim. - - SEE ALSO: gyoto_Star - */ - -//extern gyoto_Star_position; -/* xDOCUMENT pos=gyoto_Star_position(star, t) - - Return position of GYOTO Particule object STAR at time T. - - SEE ALSO: gyoto_Star_get_xyz, gyoto_Star_get_t - */ - -extern gyoto_Star_getSkyPos; -/* DOCUMENT gyoto_Star_getSkyPos, star, dalpha, ddelta, dDistance - or da_dd_dD = star(get_skypos=1) - - Return orbit projected on sky of GYOTO Star object STAR. - - SEE ALSO: gyoto_Star - */ - - -extern gyoto_Star_get_t; -extern gyoto_Star_get_xyz; -/* DOCUMENT gyoto_Star_get_xyz, star, x, y, z - or t = gyoto_Star_get_t(star) - or txyz = star(get_txyz=1) - - Return orbit (cartesian coordinates x, y, z and/or time t) of - GYOTO Star object STAR. Warning: these coordinates are a - Cartesian expression of the Boyer-Lindquist coordinates, they do - not match the Kerr-Schild coordinates. - - SEE ALSO: gyoto_Star - */ - -extern gyoto_Star_get_coord; -extern gyoto_Star_get_dot; -extern gyoto_Star_get_prime; -/* DOCUMENT gyoto_Star_get_coord, star, t, r, theta, phi - or gyoto_Star_get_dot, star, tdot, rdot, thetadot, phidot - or gyoto_Star_get_prime, star, dr_dt, dtheta_dt, dphi_dt - or coord_dot = star(get_coord=1) - - Get STAR's trajectory, quadri-velocity or classical velocity in - Boyer-Lindquist coordinates. - - INPUTS: - STAR: a Gyoto Star object as returned by gyoto_Star(); - - OUTPUTS: - t, r, theta, phi: four arrays of doubles giving the - Boyer-Lindquist coordinates of the Star along its trajectory, - as computed when initiated by gyoto_Star(); - tdot, rdot, thetadot, phidot: four arrays of doubles giving the - Boyer-Lindquist coordinates of the Star's quadri-velocity - (dx^alpha/dtau, where tau is the proper time); - dr_dt, dtheta_dt, dphi_dt: rdot/tdot, thetadot/tdot, - phidot/tdot, the three coordinates of the velocity in a - coordinate system attached to the observer. - coord_dot = [t, x0, x1, x2, tdot, x0dot, x1dot, x2dot] - - SEE ALSO: gyoto_Star - */ - -extern is_gyoto_Star; -/* DOCUMENT ret = is_gyoto_Star( obj ) - - Return 1 if OBJ is a GYOTO Star - - SEE ALSO: gyoto gyoto_Astrobj gyoto_Star is_gyoto_Astrobj -*/ diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_Torus.C gyoto-0.1.0/yorick/stdplug/gyoto_Torus.C --- gyoto-0.0.3/yorick/stdplug/gyoto_Torus.C 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_Torus.C 2013-07-27 09:14:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright 2011 Thibaut Paumard + Copyright 2011, 2013 Thibaut Paumard This file is part of Gyoto. @@ -18,7 +18,8 @@ */ #include -#include "ygyoto.h" +#include +#include "../ygyoto.h" #include "yapi.h" using namespace Gyoto; @@ -28,79 +29,27 @@ using namespace std; // on_eval worker -void ygyoto_Torus_eval(Gyoto::SmartPointer* ao_, int argc) { - int rvset[1]={0}, paUsed[1]={0}; - if (!ao_) { // Constructor mode - ao_ = ypush_Astrobj(); - *ao_ = new Torus(); - } else *ypush_Astrobj()=*ao_; +void ygyoto_Torus_eval(SmartPointer* OBJ_, int argc) { - SmartPointer *ao = (SmartPointer *)ao_; static char const * knames[]={ - "largeradius", "smallradius", "spectrum", "opacity", + "unit", "largeradius", "smallradius", "spectrum", "opacity", YGYOTO_ASTROBJ_GENERIC_KW, 0 }; - static long kglobs[YGYOTO_ASTROBJ_GENERIC_KW_N+5]; - int kiargs[YGYOTO_ASTROBJ_GENERIC_KW_N+4]; - int piargs[]={-1,-1,-1,-1}; - - yarg_kw_init(const_cast(knames), kglobs, kiargs); - - int iarg=argc, parg=0; - while (iarg>=1) { - iarg = yarg_kw(iarg, kglobs, kiargs); - if (iarg>=1) { - if (parg<4) piargs[parg++]=iarg--; - else y_error("gyoto_Astrobj takes at most 4 positional arguments"); - } - } - - int k=-1; - char const * rmsg="Cannot set return value more than once"; - char const * pmsg="Cannot use positional argument more than once"; - /* LARGERADIUS */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getLargeRadius()); - } else - (*ao)->setLargeRadius(ygets_d(iarg)) ; - } - /* RADIUS */ - if ((iarg=kiargs[++k])>=0) { - iarg+=*rvset; - if (yarg_nil(iarg)) { - if ((*rvset)++) y_error(rmsg); - ypush_double((*ao)->getSmallRadius()); - } else - (*ao)->setSmallRadius(ygets_d(iarg)) ; - } + YGYOTO_WORKER_INIT(Astrobj, Torus, knames, YGYOTO_ASTROBJ_GENERIC_KW_N+5); - /* SPECTRUM */ - if ((iarg=kiargs[++k])>=0) { - if (yarg_nil(iarg)) { - SmartPointer * sp = ypush_Spectrum(); - *sp = (*ao) -> getSpectrum(); - } else { - (*ao) -> setSpectrum ( *yget_Spectrum(iarg) ); - } - } - - /* OPACITY */ - if ((iarg=kiargs[++k])>=0) { - if (yarg_nil(iarg)) { - SmartPointer * sp = ypush_Spectrum(); - *sp = (*ao) -> getOpacity(); - } else { - (*ao) -> setOpacity ( *yget_Spectrum(iarg) ); - } - } + YGYOTO_WORKER_SET_UNIT; + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(LargeRadius); + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(SmallRadius); + YGYOTO_WORKER_GETSET_OBJECT(Spectrum); +# define ypush_Opacity ypush_Spectrum +# define yget_Opacity yget_Spectrum + YGYOTO_WORKER_GETSET_OBJECT(Opacity); +# undef ypush_Opacity +# undef yget_Opacity - // Call generic Astrobj worker - ygyoto_Astrobj_generic_eval(ao_, kiargs+k+1, piargs, rvset, paUsed); + YGYOTO_WORKER_CALL_GENERIC(Astrobj); } @@ -113,13 +62,10 @@ void Y_gyoto_Torus(int argc) { - SmartPointer *ao = NULL; - if (yarg_Astrobj(argc-1)) { - ao = yget_Astrobj(--argc); - if ((*ao)->getKind().compare("Torus")) - y_error("Expecting Astrobj of kind Star"); - } - ygyoto_Torus_eval(ao, argc); + YGYOTO_CONSTRUCTOR_INIT(Astrobj, Torus); + if ((*OBJ)->getKind().compare("Torus")) + y_error("Expecting Astrobj of kind Torus"); + ygyoto_Torus_eval(OBJ, argc); } } diff -Nru gyoto-0.0.3/yorick/stdplug/gyoto_std.i gyoto-0.1.0/yorick/stdplug/gyoto_std.i --- gyoto-0.0.3/yorick/stdplug/gyoto_std.i 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/stdplug/gyoto_std.i 2013-07-27 09:14:20.000000000 +0000 @@ -1,3 +1,5 @@ +require, "gyoto.i"; +gyoto_loadPlugin, "stdplug"; plug_in, "gyoto_std"; /* Copyright 2011 Thibaut Paumard @@ -25,8 +27,196 @@ */ __set_GyotoStdPlugSupplier, __gyoto_exportSupplier(); -#include "gyoto_Kerr.i" -#include "gyoto_Star.i" +extern _gyoto_KerrBL_register_as_Metric; +_gyoto_KerrBL_register_as_Metric; +extern _gyoto_KerrKS_register_as_Metric; +_gyoto_KerrKS_register_as_Metric; +/* xDOCUMENT _gyoto_KerrBL_register_as_Metric + should be called once so that gg(get_spin=1...) works. + */ + +extern gyoto_KerrBL; +extern gyoto_KerrKS; +/* DOCUMENT gg = gyoto_KerrBL([filename,][members=values]) + or gg = gyoto_KerrKS([filename,][members=values]) + + or gg, members=values + or value = gg(member=) + + or coord = gg(makecoord=yinit, cst) // KerrBL only + + or coefs = gg(position, mu, nu) + + PURPOSE + + Instanciate and use a GYOTO KerrBL (for Kerr Boyer-Lindquist) or + Kerr (for Kerr Kerr-Schild) Metric. + + For basics, first read "help, gyoto" and "help, gyoto_Metric". + + SPECIFIC MEMBER + + In addition to the generic Metric members, KerrBL and KerrKS + metrics have a spin that can be set and retrieved as follows: + gg, spin=value; + value = gg(spin=) + + SPECIFIC METHOD + + In addition to the generic methods provided by gyoto_Metric, + KerrBL metrics provide the following: + + coord=gg(get_coord=yinit, cst) + get 8-coordinate (4-position & 4-velocity) COORD + corresponding to the 6 coordinate (4-position & 2 + momenta) YINIT and the 3 motion constants in CST. + + SEE ALSO: gyoto, gyoto_Metric + */ +gyoto_namespace, KerrKS=gyoto_KerrKS; +gyoto_namespace, KerrBL=gyoto_KerrBL; + +/////////// STAR +extern _gyoto_Star_register_as_Astrobj; +_gyoto_Star_register_as_Astrobj +/* xDOCUMENT _gyoto_Star_register_as_Astrobj + To be called exactly once ins gyoto_Star.i +*/ + +extern gyoto_Star; +/* DOCUMENT st = gyoto_Star([filename, ][members=values]) + + or st, [members=values] + or value = st(member=) + + or st, xfill=tlim; + or data = st(function_method=parameters) + + PURPOSE: + + Create and manipulate GYOTO Star objects. Stars are a specific + kind of Gyoto Astrobj which move in the metric following + time-like geodesics and are sort of spherical (although what + "spherical" means is coordinate-system-dependent and purely + geometrical). + + There are two uses for GYOTO Stars: + - for computing the trajectory of a massive particle in the metric; + - as the light source for ray-tracing. + + For basic concepts, see gyoto and gyoto_Astrobj. + + + MEMBERS: + + In addition to the generic members described in gyoto_Astrobj, + Stars have the following members (which can be set with "st, + member=value" and retrieved with "value=st(member=)"): + radius= the radius of the sperical star, in geometrical units; + metric= the metric of which the Stars follows the geodesics; + initcoord=[x0, x1, x2, x3], [dx1/dx0, dx2/dx0, dx3/dx0] + or initcoord=[x0, x1, x2, x3, dx1/dx0, dx2/dx0, dx3/dx0] + or initcoord=[x0, x1, x2, x3, x0dot, x1dot, x2dot, x3dot] + initial position of velocity, requires metric to have + been set previously; + delta= integration step (initial if adaptive). + adaptive= whether the integration uses adaptive step. + maxiter= maximum number of iterations in integration. + + METHODS + + In addition to the generic Astrobj methods, stars provide the + following: + + Subroutine-like (st, subroutine_keyword=parameters): + reset=anything (e.g.: st, reset=; ) + Forget the result of a previous integration (see XFILL + below). + + xfill=tlim + The orbit is computed between x0 (in INITCOORD) and + tlim. XFILL requires INITIALCOOORD to have been + set. It is not guaranteed that any of the computed dates + is actually tlim, merely that the orbit is computed a + least from T0 to TLIM. + + The result of the integretation is cached inside the + star object and can be retrieved with the various get_* + methods below. Beware that changing a parameter in the + metric will ne be taken into account in the retrieved + results. To start again the integration, do one of the + following: + st, metric=new_metric; + st, initcoord=conditions; + st, reset=; + + setparameter=name,string_value + + Function-like (retval=st(function_method=parameters)): + + The following return the position of the star for all the dates + that where evaluated by the integrated when XFILL, above, was + called, in various coordinate systems: + get_skypos=screen + Retrieve RA, Dec and depth + data = st(get_skypos=screen); + da=data(,1), dd=data(,2), dD=data(,3); + SCREEN is a gyoto_Screen; + + da, dd and dD are the offsets from the center of the + Metric in RA, Dec and along the line-of-sight. + + get_txyz=anything + Retrieve Cartesian coordinates + data = st(get_txyz=); + t=data(,1), x=data(,2), y=data(,3), z=data(,4); + ANYTHING can be anything, including nil. + + get_coord= + Retrieve 8-coordinates (in Metric-prefered coord system) + data = st(get_coord=); + data(i, )=[t_i, x1_i, x2_i, x3_i, + x0dot_i, x1dot_i, x2dot_i, x3dot_i] + + get_prime= + Retrieve 3-velocity coordinates (in Metric-prefered + coord system) + data = st(get_prime=); + data(i, )=[x1dot_i/x0dot_i, x2dot_i/x0dot_i, x3dot_i/x0dot_i] + + The following retrieve coordinates for specific dates. There is + some interpolation involved which is done rather + precisely. DATES is a scalar double or an array of doubles of + any shape. All the output sub-arrays DATA(..,i) are conformable + with DATES: + + get_coord=dates Retrieve 7 coordinates: + data = star (get_coord=dates); + STAR is a Star and DATES is an array of double with N + elements. DATA will be an array of Nx7 elements where + each of the 7 subarrays DATA(,i) is conformable with + DATES. In the following, i is the index in the usual + physical notation (X0 = time): + X0 = DATES + for i in {1, 2, 3}, Xi = DATA(..,i); + for i in {0, 1, 2, 3} Xidot = DATA(..,i+4). + + get_cartesian=dates Retrieve 6-coordinates: + data = star (get_cartesian=dates); + STAR is a Star and DATES is an array of double with N + elements. DATA will be an array of Nx6 elements where + each of the 7 subarrays DATA(,i) is conformable with + DATES. + X = DATA(..,1); Y = DATA(..,2); Z = DATA(..,3); + dX/dt = DATA(..,4); dY/dt = DATA(..,5); dZ/dt = DATA(..,6); + + EXAMPLE: + data = gyoto_Star(get_txyz=1, initialpos=pos, v, xfill=tlim, + metric=gyoto_KerrBL(spin=a)); + + SEE ALSO: gyoto_Metric, gyoto_Kerr + */ +gyoto_namespace, Star=gyoto_Star; ///////// FIXEDSTAR @@ -63,6 +253,8 @@ */ +gyoto_namespace, FixedStar=gyoto_FixedStar; + //// TORUS extern _gyoto_Torus_register_as_Astrobj; _gyoto_Torus_register_as_Astrobj; @@ -85,31 +277,7 @@ SEE ALSO: gyoto, gyoto_Astrobj, gyoto_Star, gyoto_Spectrum */ - -//// PAGETHORNEDISK -extern _gyoto_PageThorneDisk_register_as_Astrobj; -_gyoto_PageThorneDisk_register_as_Astrobj; -extern gyoto_PageThorneDisk; -/* DOCUMENT disk = gyotoPageThorneDisk(...) - disk, member=value... - - This is a subkind of gyoto_ThinDisk with an emission law based on - Page & Thorne 1974. Works only in Kerr metric (KerrBL or - KerrKS). The spin is cached when the metric is set: if you later - change the spin in the metric, use the UPDATESPIN keyword to - update it, i.e.: - - disk, metric=gyoto_KerrBL(); - noop, disk(metric=)(spin=0.5); - disk, updatespin= - - KEYWORDS: - - updatespin= [] updated cached value of spin parameter. - - SEE ALSO: - gyoto_Astrobj, gyoto_ThinDisk, gyoto_KerrBL, gyoto_KerrKS -*/ +gyoto_namespace, Torus=gyoto_Torus; //// PATTERNDISK extern _gyoto_PatternDisk_register_as_Astrobj; @@ -189,8 +357,9 @@ gyoto_ThinDisk). SEE ALSO: - gyoto_Astrobj, gyoto_ThinDisk, gyotoPageThorneDisk + gyoto_Astrobj, gyoto_ThinDisk */ +gyoto_namespace, PatternDisk=gyoto_PatternDisk; //// DISK3D extern _gyoto_Disk3D_register_as_Astrobj; @@ -259,6 +428,45 @@ SEE ALSO: gyoto_Astrobj, gyoto_PatternDisk */ +gyoto_namespace, Disk3D=gyoto_Disk3D; + +//// POLISHDOUGHNUT + +extern _gyoto_PolishDoughnut_register_as_Astrobj; +_gyoto_PolishDoughnut_register_as_Astrobj; +/* xDOCUMENT _gyoto__register_as_Astrobj + To be called exactly once in gyoto_.i +*/ + +extern gyoto_PolishDoughnut; +/* DOCUMENT pd = gyoto_PolishDoughnut([filename, ][members=values]) + + or pd, members=values + or value = pd(member=) + + PURPOSE: + Create and manipulate GYOTO PolishDoughnut + objects. PolishDoughnuts are toroidal accretion structures in + KerrBL metric. They can be optically thin or optically thick and + the spectrum can be computed. + + For basic syntax, see "help, gyoto" and "help, gyoto_Astrobj". + + MEMBERS: + In addition to those listed in "help, gyoto_Astrobj": + + lambda= (a double) the lambda parameter + tempratio, centraldensity, centraltempovervirial, beta + metric= a gyoto_Metric object (KerrBL only) + + METHODS: + Some characteristic values can be retrieved with + value=pd(keyword=): + l0, Wsurface, Wcentre, rcusp, rcentre + + SEE ALSO: gyoto, gyoto_Astrobj, gyoto_KerrBL + */ +gyoto_namespace, PolishDoughnut=gyoto_PolishDoughnut; /////// SPECTRUM KIND /////// @@ -273,6 +481,7 @@ SEE ALSO: gyoto, gyoto_Spectrum */ +gyoto_namespace, PowerLawSpectrum=gyoto_PowerLawSpectrum; extern _gyoto_PowerLawSpectrum_register_as_Metric; _gyoto_PowerLawSpectrum_register_as_Metric; @@ -288,6 +497,8 @@ SEE ALSO: gyoto, gyoto_Spectrum */ +gyoto_namespace, BlackBodySpectrum=gyoto_BlackBodySpectrum; extern _gyoto_BlackBodySpectrum_register_as_Metric; _gyoto_BlackBodySpectrum_register_as_Metric; + diff -Nru gyoto-0.0.3/yorick/ygyoto.h gyoto-0.1.0/yorick/ygyoto.h --- gyoto-0.0.3/yorick/ygyoto.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/ygyoto.h 2013-07-27 09:14:20.000000000 +0000 @@ -20,14 +20,15 @@ #ifndef __YGYOTO_H #define __YGYOTO_H -#include -#include -#include -#include -#include -#include -#include -#include +#include "GyotoConfig.h" +#include "GyotoMetric.h" +#include "GyotoAstrobj.h" +#include "GyotoThinDisk.h" +#include "GyotoSpectrum.h" +#include "GyotoScreen.h" +#include "GyotoPhoton.h" +#include "GyotoScenery.h" +#include "GyotoScreen.h" #define YGYOTO_TYPE_LEN 21 #define YGYOTO_STD_CATCH catch(Gyoto::Error e) \ @@ -41,6 +42,8 @@ typedef void ygyoto_Spectrum_eval_worker_t(Gyoto::SmartPointer*,\ int); +typedef void +ygyoto_Spectrometer_eval_worker_t(Gyoto::SmartPointer*, int); #ifndef YGYOTO_LOCAL_SUPPLIER /* @@ -70,8 +73,8 @@ Gyoto::SmartPointer* yget_Spectrum(int iarg); Gyoto::SmartPointer* ypush_Spectrum(); int yarg_Spectrum(int iarg); -Gyoto::SmartPointer* yget_Spectrometer(int iarg); -Gyoto::SmartPointer* ypush_Spectrometer(); +Gyoto::SmartPointer* yget_Spectrometer(int iarg); +Gyoto::SmartPointer* ypush_Spectrometer(); int yarg_Spectrometer(int iarg); /* @@ -87,23 +90,29 @@ void ygyoto_Metric_register(char const * const kind, ygyoto_Metric_eval_worker_t* on_eval); void ygyoto_Metric_generic_eval(Gyoto::SmartPointer*, int *kiargs, int *piargs, int *rvset, - int *paUsed); + int *paUsed, char * unit); void ygyoto_Astrobj_register(char const * const kind, ygyoto_Astrobj_eval_worker_t* on_eval); void ygyoto_Astrobj_generic_eval(Gyoto::SmartPointer*, int *kiargs, int *piargs, int *rvset, - int *paUsed); + int *paUsed, char * unit); void ygyoto_ThinDisk_generic_eval(Gyoto::SmartPointer*, int *kiargs, int *piargs, int *rvset, - int *paUsed); + int *paUsed, char * unit); void ygyoto_Spectrum_register(char const * const kind, ygyoto_Spectrum_eval_worker_t*on_eval); void ygyoto_Spectrum_generic_eval (Gyoto::SmartPointer *, - int *kiargs, int *piargs, int *rvset, int *paUsed); + int *kiargs, int *piargs, int *rvset, int *paUsed, char *unit); + +void ygyoto_Spectrometer_register(char const * const kind, + ygyoto_Spectrometer_eval_worker_t*on_eval); +void ygyoto_Spectrometer_generic_eval +(Gyoto::SmartPointer *, + int *kiargs, int *piargs, int *rvset, int *paUsed, char * unit); #endif @@ -120,11 +129,11 @@ condition. */ // Keywords processed by ygyoto_Metric_generic_eval -#define YGYOTO_METRIC_GENERIC_KW "prime2tdot", \ - "nullifycoord", "kind", \ +#define YGYOTO_METRIC_GENERIC_KW "prime2tdot", \ + "nullifycoord", "kind", "setparameter", "scalarprod", \ "mass", "unitlength", "circularvelocity", "xmlwrite", "clone" // Number of those keywords -#define YGYOTO_METRIC_GENERIC_KW_N 8 +#define YGYOTO_METRIC_GENERIC_KW_N 10 // Keywords processed by ygyoto_Astrobj_generic_eval #define YGYOTO_ASTROBJ_GENERIC_KW "metric", "rmax", "opticallythin", \ @@ -133,23 +142,374 @@ #define YGYOTO_ASTROBJ_GENERIC_KW_N 7 // Keywords processed by ygyoto_ThinDisk_generic_eval -#define YGYOTO_THINDISK_GENERIC_KW "innerradius", "outerradius", "dir", \ +#define YGYOTO_THINDISK_GENERIC_KW \ + "innerradius", "outerradius", "thickness", "dir", \ YGYOTO_ASTROBJ_GENERIC_KW // number of those keywords -#define YGYOTO_THINDISK_GENERIC_KW_N 3+YGYOTO_ASTROBJ_GENERIC_KW_N +#define YGYOTO_THINDISK_GENERIC_KW_N 4+YGYOTO_ASTROBJ_GENERIC_KW_N // maximum number of keywords accepted by a base Astrobj class #define YGYOTO_ASTROBJ_BASE_MAX_KW_N YGYOTO_THINDISK_GENERIC_KW_N // Keywords processed by ygyoto_Spectrum_generic_eval -#define YGYOTO_SPECTRUM_GENERIC_KW "xmlwrite", "kind", "clone", "integrate" +#define YGYOTO_SPECTRUM_GENERIC_KW "xmlwrite", "kind", "setparameter", "clone", "integrate" +// number of those keywords +#define YGYOTO_SPECTRUM_GENERIC_KW_N 5 + +// Keywords processed by ygyoto_Spectrometer_generic_eval +#define YGYOTO_SPECTROMETER_GENERIC_KW "kind", "xmlwrite", "clone", "nsamples",\ + "setparameter", "channels", "midpoints", "widths" // number of those keywords -#define YGYOTO_SPECTRUM_GENERIC_KW_N 4 +#define YGYOTO_SPECTROMETER_GENERIC_KW_N 8 + +/* + + The following are neat for writing workers. The worker needs to + abide by my unwritten coding style. Assume MyKind is a subclass of + MyBase. MyBase is one of Metric, Astrobj, Spectrum, Spectrometer. + + void ygyoto_MyKind_eval(SmartPointer* OBJ_, int argc) { + // Define keywords + static char const * knames[]={ + "unit", + "keyword1", "keyword2", ..., "keywordN", + YGYOTO_MYBASE_GENERIC_KW, + 0 + }; + + // Parse arguments + YGYOTO_WORKER_INIT(MyBase, MyKind, knames, YGYOTO_MYBASE_GENERIC_KW_N+N+1); + + // Read unit keyword + YGYOTO_WORKER_SET_UNIT; + + // process individual keywords + YGYOTO_WORKER_GETSET_DOUBLE_UNIT(Keyword1); + ... + YGYOTO_WORKER_GETSET...(KeywordN); + + // Call generic worker + YGYOTO_WORKER_CALL_GENERIC(MyBase); + } + */ + +#define YGYOTO_STR1(X) #X +#define YGYOTO_STR(X) YGYOTO_STR1(X) +#define YGYOTO_CAT1(X, Y) X##Y +#define YGYOTO_CAT(X, Y) YGYOTO_CAT1(X,Y) + +#define YGYOTO_CONSTRUCTOR_INIT1(BASENAME, BASECLASS, DERIVEDCLASS) \ + Gyoto::SmartPointer *OBJ = NULL; \ + if (yarg_##BASENAME(argc-1)) { \ + OBJ = yget_##BASENAME(--argc); \ + GYOTO_DEBUG_EXPR(OBJ); \ + } else if (yarg_string(argc-1)) { \ + char * fname = ygets_q(argc-1); \ + OBJ = ypush_##BASENAME(); \ + GYOTO_DEBUG_EXPR(OBJ); \ + * OBJ = Gyoto::Factory(fname).get##BASENAME(); \ + GYOTO_DEBUG << "Swapping object for filename\n"; \ + yarg_swap(0, argc); \ + GYOTO_DEBUG << "Dropping filename from stack\n"; \ + yarg_drop(1); \ + GYOTO_DEBUG << "Dropped filename from stack\n"; \ + --argc; \ + } else { \ + OBJ = ypush_##BASENAME(); \ + GYOTO_DEBUG_EXPR(OBJ); \ + *OBJ = new DERIVEDCLASS(); \ + for (int arg=0; arg *OBJ = \ + (Gyoto::SmartPointer *)YGYOTO_CAT(OBJ, _); \ + static long kglobs[NKW+1]; \ + int kiargs[NKW]; \ + int piargs[]={-1,-1,-1,-1}; \ + yarg_kw_init(const_cast(KNAMES), kglobs, kiargs); \ + int iarg=argc, parg=0; \ + while (iarg>=1) { \ + iarg = yarg_kw(iarg, kglobs, kiargs); \ + if (iarg>=1) { \ + if (parg<4) piargs[parg++]=iarg--; \ + else y_error( #CLASS " worker takes at most 4 positional arguments"); \ + } \ + } \ + GYOTO_DEBUG_ARRAY(piargs, 4); \ + GYOTO_DEBUG_ARRAY(kiargs, NKW); \ + int k=-1; \ + char const * rmsg="Cannot set return value more than once"; \ + char const * pmsg="Cannot use positional argument more than once"; \ + char * unit=NULL; + + +#define YGYOTO_WORKER_GETSET_VECTOR(MEMBER, N) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error(rmsg); \ + long dims[] = {1,N}; \ + double * coord=ypush_d(dims); \ + (*OBJ)-> get##MEMBER (coord); \ + } else { \ + long ntot; \ + double * pos = ygeta_d(iarg, &ntot, NULL); \ + if (ntot set##MEMBER (pos); \ + } \ + } + +#define YGYOTO_WORKER_GETSET4(MEMBER) \ + YGYOTO_WORKER_GETSET_VECTOR(MEMBER, 4) + +#define YGYOTO_WORKER_GETSET_DOUBLE_UNIT(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error("Only one return value possible"); \ + ypush_double((*OBJ) -> get##MEMBER (unit?unit:"")); \ + } else \ + (*OBJ) -> set##MEMBER (ygets_d(iarg), unit?unit:""); \ + } + +#define YGYOTO_WORKER_GETSET_DOUBLE(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error("Only one return value possible"); \ + ypush_double((*OBJ) -> get##MEMBER ()); \ + } else \ + (*OBJ) -> set##MEMBER (ygets_d(iarg)); \ + } + +#define YGYOTO_WORKER_GET_DOUBLE(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error("Only one return value possible"); \ + ypush_double((*OBJ) -> MEMBER ()); \ + } else \ + y_error( #MEMBER " is read only"); \ + } + +#define YGYOTO_WORKER_GETSET_DOUBLE2(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error("Only one return value possible"); \ + ypush_double((*OBJ) -> MEMBER ()); \ + } else \ + (*OBJ) -> MEMBER (ygets_d(iarg)); \ + } + +#define YGYOTO_WORKER_GETSET_LONG(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error("Only one return value possible"); \ + ypush_long((*OBJ) -> get##MEMBER ()); \ + } else \ + (*OBJ) -> set##MEMBER (ygets_l(iarg)); \ + } + +#define YGYOTO_WORKER_GETSET_LONG2(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + if ((*rvset)++) y_error("Only one return value possible"); \ + ypush_long((*OBJ) -> MEMBER ()); \ + } else \ + (*OBJ) -> MEMBER (ygets_l(iarg)); \ + } + +#define YGYOTO_WORKER_GETSET_OBJECT(MEMBER) \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if (yarg_nil(iarg)) { \ + GYOTO_DEBUG << "pushing " #MEMBER << std::endl; \ + if ((*rvset)++) y_error("Only one return value possible"); \ + *ypush_##MEMBER () = (*OBJ) -> get##MEMBER (); \ + } else { \ + GYOTO_DEBUG << "setting " #MEMBER << std::endl; \ + (*OBJ) -> set##MEMBER (*yget_##MEMBER (kiargs[k])); \ + } \ + } + +#define YGYOTO_WORKER_SET_UNIT \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + GYOTO_DEBUG << "set unit" << std::endl; \ + unit = ygets_q(iarg); \ + } + +#define YGYOTO_WORKER_SETPARAMETER \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + if ((*paUsed)++) y_error("pmsg"); \ + string name = ygets_q(iarg); \ + string content = ""; \ + if (piargs[0] >= 0) content = ygets_q(*piargs); \ + try { \ + (*OBJ)->setParameter(name, content, unit?unit:""); \ + } YGYOTO_STD_CATCH; \ + } + +#ifdef GYOTO_USE_XERCES +# define YGYOTO_WORKER_XMLWRITE \ + if ((iarg=kiargs[++k])>=0) { \ + iarg+=*rvset; \ + char *filename=ygets_q(iarg); \ + Gyoto::Factory(*OBJ).write(filename); \ + } +#else +# define YGYOTO_WORKER_XMLWRITE \ + if ((iarg=kiargs[++k])>=0) { \ + y_error("This GYOTO was compiled without xerces: no xml i/o"); \ + } +#endif + +#define YGYOTO_WORKER_CLONE(TYPE) \ + if ((iarg=kiargs[++k])>=0) { \ + if ((*rvset)++) y_error(rmsg); \ + *ypush_##TYPE () = (*OBJ)->clone(); \ + } + +#define YGYOTO_WORKER_RUN(METHOD) \ + if ((iarg=kiargs[++k])>=0) { \ + GYOTO_DEBUG << #METHOD << std::endl ; \ + iarg+=*rvset; \ + (*OBJ)-> METHOD ; \ + } + +#define YGYOTO_WORKER_CALL_GENERIC(BASE) \ + ygyoto_##BASE##_generic_eval(YGYOTO_CAT(OBJ,_), \ + kiargs+k+1, piargs, rvset, paUsed, unit); + + +/* + The following are to declare a new base (such as Metric or Astrobj) + or independent (such as Photon) class. Seldom used in a Gyoto + extension. + */ +#ifdef GYOTO_USE_XERCES +# define YGYOTO_PRINT_YUSEROBJ(NAME) \ + void gyoto_##NAME##_print(void *obj) { \ + string rest="", sub=""; \ + size_t pos=0, len=0; \ + try {rest = Factory(((gyoto_##NAME*)obj)->smptr).format();} \ + YGYOTO_STD_CATCH; \ + while (len=rest.length()) { \ + sub=rest.substr(0, pos=rest.find_first_of("\n",0)); \ + rest=rest.substr(pos+1, len-1); \ + y_print( sub.c_str(),1 ); \ + } \ + } +#else +# define YGYOTO_PRINT_YUSEROBJ(NAME) \ + void gyoto_##NAME##_print(void *obj) { \ + y_print("GYOTO " #NAME,0); \ + } +#endif +#define YGYOTO_YUSEROBJ(NAME, CLASS) \ + extern "C" { \ + typedef struct gyoto_##NAME { \ + Gyoto::SmartPointer smptr; \ + } gyoto_##NAME; \ + void gyoto_##NAME##_free(void *obj) { \ + if (((gyoto_##NAME*)obj)->smptr) { \ + ((gyoto_##NAME*)obj)->smptr=NULL; \ + } else printf("null pointer\n"); \ + } \ + YGYOTO_PRINT_YUSEROBJ(NAME) \ + void gyoto_##NAME##_eval(void *obj, int argc); \ + void gyoto_##NAME##_extract(void *obj, char *member) { \ + long idxo = yget_global("__gyoto_obj", 0); \ + long idxr = yget_global("__gyoto_res", 0); \ + *ypush_##NAME()= ((gyoto_##NAME*)obj)->smptr; \ + yput_global(idxo, 0); \ + yarg_drop(1); \ + long dims[Y_DIMSIZE]={1,1}; \ + string stmt = "eq_nocopy, __gyoto_res, __gyoto_obj("; \ + stmt.append(member).append("=);"); \ + *ypush_q(dims)=p_strcpy(stmt.c_str()); \ + yexec_include(0, 1); \ + yarg_drop(1); \ + ypush_global(idxr); \ + } \ + static y_userobj_t gyoto_##NAME##_obj = \ + {const_cast("gyoto_" #NAME), \ + &gyoto_##NAME##_free, \ + &gyoto_##NAME##_print, \ + &gyoto_##NAME##_eval, \ + &gyoto_##NAME##_extract, \ + 0}; \ + } \ + Gyoto::SmartPointer* yget_##NAME(int iarg) { \ + return &(((gyoto_##NAME*)yget_obj(iarg, &gyoto_##NAME##_obj))->smptr); \ + } \ + Gyoto::SmartPointer* ypush_##NAME() { \ + return &(((gyoto_##NAME*)ypush_obj(&gyoto_##NAME##_obj, \ + sizeof(gyoto_##NAME)))->smptr); \ + } \ + int yarg_##NAME(int iarg) { \ + return yget_obj(iarg,0)==gyoto_##NAME##_obj.type_name; \ + } \ + extern "C" { \ + void Y_is_gyoto_##NAME(int argc) \ + { \ + ypush_long(yarg_##NAME(0)); \ + } \ + } +#define YGYOTO_BASE_CONSTRUCTOR(BASE) \ + extern "C" { \ + void Y_gyoto_##BASE(int argc) { \ + Gyoto::SmartPointer *OBJ = NULL; \ + if (yarg_##BASE(argc-1)) { \ + OBJ = yget_##BASE(argc); \ + } else { \ + if (!yarg_string(argc-1)) \ + y_error("Cannot allocate object of virtual class " #BASE); \ + char * fname = ygets_q(argc-1); \ + OBJ = ypush_##BASE(); \ + Gyoto::BASE::Subcontractor_t * sub = \ + Gyoto::BASE::getSubcontractor(fname, 1); \ + if (sub) { \ + GYOTO_DEBUG << "found a subcontractor for \"" << fname \ + << "\", calling it now\n"; \ + *OBJ = (*sub)(NULL); \ + } else { \ + GYOTO_DEBUG << "found no subcontractor for \"" << fname \ + << "\", calling Factory now\n"; \ + *OBJ = Factory(fname).get##BASE(); \ + } \ + yarg_swap(0, argc); \ + yarg_drop(1); \ + } \ + --argc; \ + gyoto_##BASE##_eval(OBJ, argc); \ + } \ +} + /* The following are needed to export the ABI to other plug-ins. + You usually don't need to read below this line. + */ typedef Gyoto::SmartPointer *ygyoto_yget_Metric_t(int); @@ -157,14 +517,14 @@ typedef int yarg_OBJTYPE_t(int); typedef void ygyoto_Metric_register_t(char const * const, ygyoto_Metric_eval_worker_t*); typedef void ygyoto_Metric_generic_eval_t(Gyoto::SmartPointer*, \ - int *, int *, int*, int*); + int *, int *, int*, int*, char *); typedef Gyoto::SmartPointer *ygyoto_yget_Astrobj_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Astrobj_t(); //typedef int yarg_Astrobj_t(int); typedef void ygyoto_Astrobj_register_t(char const * const, ygyoto_Astrobj_eval_worker_t*); typedef void ygyoto_Astrobj_generic_eval_t \ -(Gyoto::SmartPointer*, int *, int *, int*, int*); +(Gyoto::SmartPointer*, int *, int *, int*, int*, char *); typedef Gyoto::SmartPointer *\ ygyoto_yget_Spectrum_t(int); @@ -174,7 +534,7 @@ typedef void ygyoto_Spectrum_register_t\ (char const*const, ygyoto_Spectrum_eval_worker_t*); typedef void ygyoto_Spectrum_generic_eval_t \ -(Gyoto::SmartPointer*, int *, int *, int*, int*); +(Gyoto::SmartPointer*, int *, int *, int*, int*, char*); typedef Gyoto::SmartPointer *ygyoto_yget_Screen_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Screen_t(); @@ -185,6 +545,16 @@ typedef Gyoto::SmartPointer *ygyoto_yget_Photon_t(int); typedef Gyoto::SmartPointer *ygyoto_ypush_Photon_t(); +typedef Gyoto::SmartPointer *\ +ygyoto_yget_Spectrometer_t(int); +typedef Gyoto::SmartPointer *\ +ygyoto_ypush_Spectrometer_t(); +//typedef int yarg_Spectrometer::Generic_t(int); +typedef void ygyoto_Spectrometer_register_t\ +(char const*const, ygyoto_Spectrometer_eval_worker_t*); +typedef void ygyoto_Spectrometer_generic_eval_t \ +(Gyoto::SmartPointer*, int *, int *, int*, int*, char*); + typedef struct YGyotoSupplier { // Metric ygyoto_yget_Metric_t *yget_Metric; @@ -217,6 +587,12 @@ ygyoto_yget_Photon_t *yget_Photon; ygyoto_ypush_Photon_t *ypush_Photon; yarg_OBJTYPE_t *yarg_Photon; + // Spectrometer + ygyoto_yget_Spectrometer_t *yget_Spectrometer; + ygyoto_ypush_Spectrometer_t *ypush_Spectrometer; + yarg_OBJTYPE_t *yarg_Spectrometer; + ygyoto_Spectrometer_register_t *ygyoto_Spectrometer_register; + ygyoto_Spectrometer_generic_eval_t* ygyoto_Spectrometer_generic_eval; } YGyotoSupplier_t; @@ -231,9 +607,9 @@ #define ygyoto_Metric_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Metric_register(kind, on_eval) -#define ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed) \ - YGYOTO_LOCAL_SUPPLIER -> \ - ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed) +#define ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ + YGYOTO_LOCAL_SUPPLIER -> \ + ygyoto_Metric_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define yget_Astrobj(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Astrobj(iarg) #define ypush_Astrobj() YGYOTO_LOCAL_SUPPLIER -> ypush_Astrobj() @@ -241,12 +617,12 @@ #define ygyoto_Astrobj_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Astrobj_register(kind, on_eval) -#define ygyoto_Astrobj_generic_eval(gg, kiargs, piargs, rvset, paUsed) \ +#define ygyoto_Astrobj_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ - ygyoto_Astrobj_generic_eval(gg, kiargs, piargs, rvset, paUsed) -#define ygyoto_ThinDisk_generic_eval(gg, kiargs, piargs, rvset, paUsed) \ + ygyoto_Astrobj_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) +#define ygyoto_ThinDisk_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ - ygyoto_ThinDisk_generic_eval(gg, kiargs, piargs, rvset, paUsed) + ygyoto_ThinDisk_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define yget_Spectrum(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Spectrum(iarg) #define ypush_Spectrum() YGYOTO_LOCAL_SUPPLIER -> ypush_Spectrum() @@ -254,9 +630,9 @@ #define ygyoto_Spectrum_register(kind, on_eval) \ YGYOTO_LOCAL_SUPPLIER -> \ ygyoto_Spectrum_register(kind, on_eval) -#define ygyoto_Spectrum_generic_eval(gg, kiargs, piargs, rvset, paUsed) \ +#define ygyoto_Spectrum_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) \ YGYOTO_LOCAL_SUPPLIER -> \ - ygyoto_Spectrum_generic_eval(gg, kiargs, piargs, rvset,paUsed) + ygyoto_Spectrum_generic_eval(gg, kiargs, piargs, rvset, paUsed, unit) #define yget_Screen(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Screen(iarg) #define ypush_Screen() YGYOTO_LOCAL_SUPPLIER -> ypush_Screen() @@ -270,6 +646,16 @@ #define ypush_Photon() YGYOTO_LOCAL_SUPPLIER -> ypush_Photon() #define yarg_Photon(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Photon(iarg) +#define yget_Spectrometer(iarg) YGYOTO_LOCAL_SUPPLIER -> yget_Spectrometer(iarg) +#define ypush_Spectrometer() YGYOTO_LOCAL_SUPPLIER -> ypush_Spectrometer() +#define yarg_Spectrometer(iarg) YGYOTO_LOCAL_SUPPLIER -> yarg_Spectrometer(iarg) +#define ygyoto_Spectrometer_register(kind, on_eval) \ + YGYOTO_LOCAL_SUPPLIER -> \ + ygyoto_Spectrometer_register(kind, on_eval) +#define ygyoto_Spectrometer_generic_eval(gg, kiargs, piargs, rvset, paUsed) \ + YGYOTO_LOCAL_SUPPLIER -> \ + ygyoto_Spectrometer_generic_eval(gg, kiargs, piargs, rvset,paUsed) + #endif diff -Nru gyoto-0.0.3/yorick/ygyoto_idx.h gyoto-0.1.0/yorick/ygyoto_idx.h --- gyoto-0.0.3/yorick/ygyoto_idx.h 2012-05-01 11:41:58.000000000 +0000 +++ gyoto-0.1.0/yorick/ygyoto_idx.h 2013-07-27 09:14:20.000000000 +0000 @@ -29,6 +29,7 @@ int _is_list; int _is_scalar; int _is_double; + int _is_first; long _range[3]; double _dval; @@ -48,6 +49,8 @@ long current(); double getDVal(); int isDouble(); + int isFirst(); + int isLast(); };