osra-2.1.3/ 0000775 0001750 0001750 00000000000 14115175270 011150 5 ustar igor igor osra-2.1.3/pom.xml.in 0000664 0001750 0001750 00000004073 14115175252 013076 0 ustar igor igor
4.0.0
net.sf.osra
osra
jar
@PACKAGE_VERSION@
OSRA
http://osra.sourceforge.net/
https://osra.svn.sourceforge.net/svnroot/osra/trunk
SourceForge
https://sourceforge.net/tracker/?group_id=203833&atid=987182
GPLv2 License
http://www.gnu.org/licenses/gpl-2.0.txt
net.sf.jnati
jnati-deploy
0.4
log4j
log4j
junit
junit
4.8.2
test
commons-io
commons-io
1.4
test
maven-deploy-plugin
2.7
addons/java
osra-2.1.3/package/ 0000775 0001750 0001750 00000000000 14115175252 012543 5 ustar igor igor osra-2.1.3/package/win32/ 0000775 0001750 0001750 00000000000 14115175252 013505 5 ustar igor igor osra-2.1.3/package/win32/osra.nsi.in 0000775 0001750 0001750 00000023345 14115175252 015603 0 ustar igor igor !define DOT_VERSION "@PACKAGE_VERSION@"
!define DASH_VERSION "@PACKAGE_VERSION_WITH_DASHES@"
!include Sections.nsh
; include for some of the windows messages defines
!include "winmessages.nsh"
; HKLM (all users) vs HKCU (current user) defines
!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!define env_hkcu 'HKCU "Environment"'
!include "TextFunc.nsh"
!insertmacro LineFind
; The name of the installer
Name "Optical Structure Recognition Application"
; The file to write
OutFile "osra-setup-${DASH_VERSION}.exe"
; The default installation directory
InstallDir $PROGRAMFILES\osra\${DOT_VERSION}
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\osra\${DOT_VERSION}" "Install_Dir"
LicenseData "license.txt"
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
; Pages
Page license
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "osra (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "osra-bin.exe"
; File "pthreadGC2.dll"
File "README.txt"
File "spelling.txt"
File "superatom.txt"
call createOSRAbat
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\osra\${DOT_VERSION} "Install_Dir" "$INSTDIR"
WriteRegStr HKLM SOFTWARE\osra "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\osra" "DisplayName" "OSRA ${DOT_VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\osra" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\osra" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\osra" "NoRepair" 1
WriteUninstaller "uninstall.exe"
; set variable
WriteRegExpandStr ${env_hklm} OSRA "$INSTDIR"
; make sure windows knows about the change
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
SectionEnd
Section /o "BIOVIA Draw plugin" symyx_draw
call getSymyxPath
strcmp $1 "" no_symyx
SetOutPath "$1\AddIns"
File "plugins\symyx_draw\OSRAAction.xml"
SetOutPath "$1\AddIns\OSRAAction"
File "plugins\symyx_draw\OSRAAction\README.txt"
File "plugins\symyx_draw\OSRAAction\OSRAAction.dll"
Goto done
no_symyx:
MessageBox MB_OK "BIOVIA Draw not found" IDOK done
done:
SectionEnd
; Uninstaller
Section "Uninstall"
# call userInfo plugin to get user info. The plugin puts the result in the stack
userInfo::getAccountType
# pop the result from the stack into $0
pop $0
# compare the result with the string "Admin" to see if the user is admin.
# If match, jump 3 lines down.
strCmp $0 "Admin" +3
# if there is not a match, print message and return
messageBox MB_OK "Please run this with Administrator privileges"
Quit
ReadRegStr $0 HKLM SOFTWARE\osra\${DOT_VERSION} "Install_Dir"
strcpy $INSTDIR $0
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\osra"
DeleteRegKey HKLM SOFTWARE\osra\${DOT_VERSION}
; delete variable
DeleteRegValue ${env_hklm} OSRA
; make sure windows knows about the change
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
; Remove files and uninstaller
Delete $INSTDIR\osra-bin.exe
; Delete $INSTDIR\pthreadGC2.dll
Delete $INSTDIR\README.txt
Delete $INSTDIR\osra.bat
Delete $INSTDIR\superatom.txt
Delete $INSTDIR\spelling.txt
Delete $INSTDIR\uninstall.exe
RMDir "$INSTDIR"
call un.getSymyxPath
strcmp $1 "" no_symyx
Delete "$1\AddIns\OSRAAction.xml"
Delete "$1\AddIns\OSRAAction\README.txt"
Delete "$1\AddIns\OSRAAction\OSRAAction.dll"
Delete "$1\AddIns\OSRAAction\OSRAAction.dll.config"
RMDir "$1\AddIns\OSRAAction"
no_symyx:
SectionEnd
Function getSymyxPath
Push "$PROGRAMFILES\BIOVIA"
Push "BIOVIADraw.exe"
Call FindIt
Pop $R1
Push "$R1"
Call GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1BIOVIADraw.exe fin
Push "$PROGRAMFILES64\BIOVIA"
Push "BIOVIADraw.exe"
Call FindIt
Pop $R1
Push "$R1"
Call GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1BIOVIADraw.exe fin
Push "$PROGRAMFILES\Accelrys"
Push "AccelrysDraw.exe"
Call FindIt
Pop $R1
Push "$R1"
Call GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1AccelrysDraw.exe fin
Push "$PROGRAMFILES64\Accelrys"
Push "AccelrysDraw.exe"
Call FindIt
Pop $R1
Push "$R1"
Call GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1AccelrysDraw.exe fin
Push "$PROGRAMFILES\Symyx"
Push "SymyxDraw.exe"
Call FindIt
Pop $R1
Push "$R1"
Call GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1SymyxDraw.exe fin
Push "$PROGRAMFILES64\Symyx"
Push "SymyxDraw.exe"
Call FindIt
Pop $R1
Push "$R1"
Call GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1SymyxDraw.exe fin
StrCpy $1 ""
fin:
;$1 contains the folder of Symyx Draw or empty
FunctionEnd
Function un.getSymyxPath
Push "$PROGRAMFILES\BIOVIA"
Push "BIOVIADraw.exe"
Call un.FindIt
Pop $R1
Push "$R1"
Call un.GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1BIOVIADraw.exe fin
Push "$PROGRAMFILES64\BIOVIA"
Push "BIOVIADraw.exe"
Call un.FindIt
Pop $R1
Push "$R1"
Call un.GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1BIOVIADraw.exe fin
Push "$PROGRAMFILES\Accelrys"
Push "AccelrysDraw.exe"
Call un.FindIt
Pop $R1
Push "$R1"
Call un.GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1AccelrysDraw.exe fin
Push "$PROGRAMFILES64\Accelrys"
Push "AccelrysDraw.exe"
Call un.FindIt
Pop $R1
Push "$R1"
Call un.GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1AccelrysDraw.exe fin
Push "$PROGRAMFILES\Symyx"
Push "SymyxDraw.exe"
Call un.FindIt
Pop $R1
Push "$R1"
Call un.GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1SymyxDraw.exe fin
Push "$PROGRAMFILES64\Symyx"
Push "SymyxDraw.exe"
Call un.FindIt
Pop $R1
Push "$R1"
Call un.GetParent
Pop $R0
StrCpy $1 "$R0\"
IfFileExists $1SymyxDraw.exe fin
StrCpy $1 ""
fin:
;$1 contains the folder of Symyx Draw or empty
FunctionEnd
Function createOSRAbat
fileOpen $0 "$INSTDIR\osra.bat" w
fileWrite $0 '\
@echo off$\r$\n\
setlocal$\r$\n\
set exec_dir=%~dp0%$\r$\n\
set PATH=%exec_dir%;$1\bin;$1\lib;%PATH%$\r$\n\
"%exec_dir%osra-bin.exe" %*$\r$\n\
endlocal$\r$\n\
'
fileClose $0
FunctionEnd
Function .onInit
# call userInfo plugin to get user info. The plugin puts the result in the stack
userInfo::getAccountType
# pop the result from the stack into $0
pop $0
# compare the result with the string "Admin" to see if the user is admin.
# If match, jump 3 lines down.
strCmp $0 "Admin" +3
# if there is not a match, print message and return
messageBox MB_OK "Please run this with Administrator privileges"
Quit
call getSymyxPath
strcmp $1 "" no_symyx
SectionGetFlags "${symyx_draw}" $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags "${symyx_draw}" $0
no_symyx:
FunctionEnd
Function FindIt
Exch $R0
Exch
Exch $R1
Push $R2
Push $R3
Push $R4
Push $R5
Push $R6
StrCpy $R6 -1
StrCpy $R3 1
Push $R1
nextDir:
Pop $R1
IntOp $R3 $R3 - 1
ClearErrors
FindFirst $R5 $R2 "$R1\*.*"
nextFile:
StrCmp $R2 "." gotoNextFile
StrCmp $R2 ".." gotoNextFile
StrCmp $R2 $R0 0 isDir
StrCpy $R6 "$R1\$R2"
loop:
StrCmp $R3 0 done
Pop $R1
IntOp $R3 $R3 - 1
Goto loop
isDir:
IfFileExists "$R1\$R2\*.*" 0 gotoNextFile
IntOp $R3 $R3 + 1
Push "$R1\$R2"
gotoNextFile:
FindNext $R5 $R2
IfErrors 0 nextFile
done:
FindClose $R5
StrCmp $R3 0 0 nextDir
StrCpy $R0 $R6
Pop $R6
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function GetParent
Exch $R0
Push $R1
Push $R2
Push $R3
StrCpy $R1 0
StrLen $R2 $R0
loop:
IntOp $R1 $R1 + 1
IntCmp $R1 $R2 get 0 get
StrCpy $R3 $R0 1 -$R1
StrCmp $R3 "\" get
Goto loop
get:
StrCpy $R0 $R0 -$R1
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function un.FindIt
Exch $R0
Exch
Exch $R1
Push $R2
Push $R3
Push $R4
Push $R5
Push $R6
StrCpy $R6 -1
StrCpy $R3 1
Push $R1
nextDir:
Pop $R1
IntOp $R3 $R3 - 1
ClearErrors
FindFirst $R5 $R2 "$R1\*.*"
nextFile:
StrCmp $R2 "." gotoNextFile
StrCmp $R2 ".." gotoNextFile
StrCmp $R2 $R0 0 isDir
StrCpy $R6 "$R1\$R2"
loop:
StrCmp $R3 0 done
Pop $R1
IntOp $R3 $R3 - 1
Goto loop
isDir:
IfFileExists "$R1\$R2\*.*" 0 gotoNextFile
IntOp $R3 $R3 + 1
Push "$R1\$R2"
gotoNextFile:
FindNext $R5 $R2
IfErrors 0 nextFile
done:
FindClose $R5
StrCmp $R3 0 0 nextDir
StrCpy $R0 $R6
Pop $R6
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function un.GetParent
Exch $R0
Push $R1
Push $R2
Push $R3
StrCpy $R1 0
StrLen $R2 $R0
loop:
IntOp $R1 $R1 + 1
IntCmp $R1 $R2 get 0 get
StrCpy $R3 $R0 1 -$R1
StrCmp $R3 "\" get
Goto loop
get:
StrCpy $R0 $R0 -$R1
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd osra-2.1.3/package/android/ 0000775 0001750 0001750 00000000000 14115175252 014163 5 ustar igor igor osra-2.1.3/package/android/runosra.java 0000664 0001750 0001750 00000006004 14115175252 016517 0 ustar igor igor package cadd.osra.main;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TextView;
public class runosra extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
writeToStream(getAssets().open("spelling.txt"), openFileOutput("spelling.txt", MODE_WORLD_READABLE ));
} catch (Exception e) {
e.printStackTrace();
}
try {
writeToStream(getAssets().open("superatom.txt"), openFileOutput("superatom.txt", MODE_WORLD_READABLE));
} catch (Exception e) {
e.printStackTrace();
}
byte [] rawimage=null;
try {
rawimage=writeToArray(getAssets().open("c.jpg"));
} catch (Exception e) {
e.printStackTrace();
}
File spelling=getFileStreamPath("spelling.txt");
File superatom=getFileStreamPath("superatom.txt");
//File image=getFileStreamPath("chemnav.png");
//TextView tv = new TextView(this);
String [] jargv= {"osra","-f","inchi","-l",spelling.getAbsolutePath(),"-a",superatom.getAbsolutePath()};
String inchi=nativeosra(jargv,rawimage);
String enc_inchi="";
try {
enc_inchi=URLEncoder.encode(inchi, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
if (enc_inchi.length()!=0) {
//String base_url="http://en.wikipedia.org/wiki/Special:Search?fulltext=Search&search=";
String base_url="http://129.43.27.140/cgi-bin/lookup/results?type=inchi&context_all=all&query=";
String url=base_url+enc_inchi;
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
//tv.setText( enc_inchi );
//setContentView(tv);
}
public native String nativeosra(String [] jargv, byte [] rawimage);
static {
System.loadLibrary("openbabel");
System.loadLibrary("osra");
}
public static void writeToStream(InputStream in , OutputStream out) throws IOException
{
byte[] bytes = new byte[2048];
for (int c = in.read(bytes); c != -1; c = in.read(bytes)) {
out.write(bytes,0, c);
}
in.close();
out.close();
}
public static byte [] writeToArray(InputStream in) throws IOException
{
ByteArrayOutputStream out=new ByteArrayOutputStream();
byte[] bytes = new byte[2048];
for (int c = in.read(bytes); c != -1; c = in.read(bytes)) {
out.write(bytes,0, c);
}
in.close();
//byte [] prep = new byte[out.size()];
byte [] arr=out.toByteArray();
out.close();
return arr;
}
}
osra-2.1.3/package/osx/ 0000775 0001750 0001750 00000000000 14115175252 013354 5 ustar igor igor osra-2.1.3/package/osx/install.sh.in 0000775 0001750 0001750 00000001202 14115175252 015761 0 ustar igor igor #!/bin/bash
if (( $EUID != 0 )); then
echo "The installation must be run as root" 1>&2
exit 1
fi
mkdir -p /opt/local/@PACKAGE_NAME@/@PACKAGE_VERSION@ || { echo "Cannot create /opt/local/@PACKAGE_NAME@ folder" 1>&2; exit; }
mkdir -p /usr/local/bin || { echo "Cannot create /usr/local/bin folder" 1>&2; exit; }
cp -f package/* /opt/local/@PACKAGE_NAME@/@PACKAGE_VERSION@/ || { echo "Cannot copy to /opt/local/@PACKAGE_NAME@ folder" 1>&2; exit; }
echo "Installing binary files in /opt/local/@PACKAGE_NAME@"
cp -f osra /usr/local/bin || { echo "Cannot copy to /usr/local/bin" 1>&2; exit; }
echo "Installing osra script in /usr/local/bin"
osra-2.1.3/package/osx/INSTALL 0000664 0001750 0001750 00000000412 14115175252 014402 0 ustar igor igor To install run (as a root or via sudo)
./install.sh
It will copy the contents of "package" into /opt/local/osra
and the wrap-around shell script "osra" into /usr/local/bin
Starting with version 2.1.0 Ghostscript is no longer necessary
to process PDF and PS files.
osra-2.1.3/package/osx/setup_env 0000775 0001750 0001750 00000000570 14115175252 015314 0 ustar igor igor #!/bin/sh
defaults write ~/.MacOSX/environment OSRA /usr/local/bin/
chown $USER ~/.MacOSX/environment.plist
chmod a+r ~/.MacOSX/environment.plist
launchctl setenv OSRA /usr/local/bin/
chmod a+rx /usr/local/bin/osra
chmod a+rx /usr/local/lib/libopenabel.3.dylib
chmod a+rx /usr/local/lib/libopenabel.dylib
chmod a+rx /usr/local/lib/libopenabel.la
chmod -R a+rx /opt/local/osra/ osra-2.1.3/package/osx/osra.sh.in 0000775 0001750 0001750 00000000102 14115175252 015255 0 ustar igor igor #!/bin/sh
/opt/local/@PACKAGE_NAME@/@PACKAGE_VERSION@/osra-bin $*
osra-2.1.3/package/linux/ 0000775 0001750 0001750 00000000000 14115175252 013702 5 ustar igor igor osra-2.1.3/package/linux/install-user.sh.in 0000775 0001750 0001750 00000000510 14115175251 017263 0 ustar igor igor #!/bin/bash
mkdir -p $HOME/@PACKAGE_NAME@/@PACKAGE_VERSION@ || { echo "Cannot create $HOME/@PACKAGE_NAME@ folder" 1>&2; exit; }
cp --remove-destination package/* $HOME/@PACKAGE_NAME@/@PACKAGE_VERSION@/ || { echo "Cannot copy to $HOME/@PACKAGE_NAME@ folder" 1>&2; exit; }
echo "Installing binary files in $HOME/@PACKAGE_NAME@"
osra-2.1.3/package/linux/suse/ 0000775 0001750 0001750 00000000000 14115175251 014660 5 ustar igor igor osra-2.1.3/package/linux/suse/osra.spec.in 0000664 0001750 0001750 00000010156 14115175251 017110 0 ustar igor igor #
# spec file for package OSRA
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%define name @PACKAGE_NAME@
%define version @PACKAGE_VERSION@
%define builddep glibc-devel, libstdc++45-devel, tclap >= 1.2, potrace-devel >= 1.8, gocr-devel >= 0.49, ocrad-devel >= 0.20, libopenbabel-devel >= 2.3, libGraphicsMagick++-devel >= 1.3.10, cuneiform-devel => 1.1.0, tesseract-devel => 3.01, docbook-xsl-stylesheets => 1.74.0, libxslt
%define binarydep potrace-lib >= 1.8, libopenbabel3 >= 2.3, libGraphicsMagick++3 >= 1.3.10, cuneiform => 1.1.0, tesseract => 3.01, %{name}-common = %{version}
Name: %{name}
BuildRequires: %{builddep}
Url: http://osra.sourceforge.net/
Summary: A command line chemical structure recognition tool
Version: %{version}
Release: 1.0
Group: Productivity/Graphics/Other
Requires: %{binarydep}
License: GPL v2 or later
Source0: %{name}-%{version}.tar.bz2
#Patch0: Makefile.in.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: @build_cpu@
%description
OSRA is a utility designed to convert graphical representations of chemical structures into SMILES or SDF.
OSRA can read a document in any of the over 90 graphical formats parseable by GraphicMagick and generate
the SMILES or SDF representation of the molecular structure images encountered within that document.
Authors:
--------
Igor Filippov
%package common
Summary: OSRA shared files
Group: Productivity/Graphics/Other
BuildArch: noarch
%description common
This package contains the shared files for OSRA executable / library.
%package lib@LIB_MAJOR_VERSION@
Summary: OSRA C++ library
Group: Development/Libraries/C and C++
Requires: %{binarydep}
%description lib@LIB_MAJOR_VERSION@
This package contains the dynamic library needed to consume OSRA functionality
from C++ programs.
%package lib-java@LIB_MAJOR_VERSION@
Summary: OSRA Java library
Group: Development/Libraries/C and C++
Requires: %{binarydep}
%description lib-java@LIB_MAJOR_VERSION@
This package contains the dynamic library needed to consume OSRA functionality
from Java programs.
%package devel
Summary: OSRA static library and header files mandatory for development
Group: Development/Libraries/C and C++
Requires: %{name}-lib@LIB_MAJOR_VERSION@ = %{version}
%description devel
This package contains all necessary include files and libraries needed
to develop applications on the top of OSRA.
%prep
%setup -n %{name}-%{version}
#%patch0 -p0
%build
# See http://stackoverflow.com/questions/3113472/how-to-make-an-rpm-spec-that-installs-libraries-to-usr-lib-xor-usr-lib64-based
# See http://www.rpm.org/api/4.4.2.2/config_macros.html
%configure --enable-docs --enable-lib --enable-java --with-tesseract --with-cuneiform --datadir=%{_datadir}/%{name} --docdir=%{_datadir}/doc/packages/%{name}
%__make
%install
# See http://fedoraproject.org/wiki/PackagingGuidelines#Why_the_.25makeinstall_macro_should_not_be_used
%__make install DESTDIR=%{buildroot}
%clean
%__rm -rf $RPM_BUILD_ROOT
%define _sharedir %{_prefix}/share
%files
%defattr(-, root, root)
%{_prefix}/bin/%{name}
%{_mandir}/man?/%{name}.*
%files common
%{_sharedir}/%{name}
%{_sharedir}/doc
%files lib@LIB_MAJOR_VERSION@
%defattr(-,root,root)
%{_libdir}/lib%{name}.so*
%files lib-java@LIB_MAJOR_VERSION@
%defattr(-,root,root)
%{_libdir}/lib%{name}_java.so*
%files devel
%defattr(-,root,root)
%{_libdir}/lib%{name}.a
%{_libdir}/pkgconfig
%{_includedir}
# spec file ends here
%changelog
* Thu Jul 01 2011 dma_k@mail.ru
- Initial SuSE package
osra-2.1.3/package/linux/debian/ 0000775 0001750 0001750 00000000000 14115175251 015123 5 ustar igor igor osra-2.1.3/package/linux/debian/compat 0000664 0001750 0001750 00000000002 14115175251 016321 0 ustar igor igor 7
osra-2.1.3/package/linux/debian/changelog 0000664 0001750 0001750 00000000221 14115175251 016770 0 ustar igor igor osra (2.0.0-1) unstable; urgency=low
* Initial release (closes: #682760)
-- Dmitry Katsubo Mon, 15 Dec 2014 17:05:38 +0200
osra-2.1.3/package/linux/debian/patches/ 0000775 0001750 0001750 00000000000 14115175251 016552 5 ustar igor igor osra-2.1.3/package/linux/debian/patches/series 0000664 0001750 0001750 00000000000 14115175251 017755 0 ustar igor igor osra-2.1.3/package/linux/debian/copyright.new 0000664 0001750 0001750 00000000436 14115175251 017651 0 ustar igor igor Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
Name: osra
Maintainer: Dmitry Katsubo
Source: https://osra.svn.sourceforge.net/svnroot/osra/
Files: *
Copyright: 2007-2013 Igor Filippov
License: GPL-2+
osra-2.1.3/package/linux/debian/libosra.install 0000664 0001750 0001750 00000000026 14115175251 020144 0 ustar igor igor /usr/lib/libosra.so*
osra-2.1.3/package/linux/debian/libosra-dev.install 0000664 0001750 0001750 00000000066 14115175251 020724 0 ustar igor igor /usr/lib/libosra.a
/usr/lib/pkgconfig
/usr/include
osra-2.1.3/package/linux/debian/watch 0000664 0001750 0001750 00000000402 14115175251 016150 0 ustar igor igor # You can run the "uscan" command to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
http://sf.net/osra/osra-(.*)\.tgz
osra-2.1.3/package/linux/debian/osra-common.install 0000664 0001750 0001750 00000000041 14115175251 020740 0 ustar igor igor /usr/share/osra
/usr/share/doc
osra-2.1.3/package/linux/debian/copyright 0000664 0001750 0001750 00000002164 14115175251 017061 0 ustar igor igor This work was packaged for Debian by:
Dmitry Katsubo on Tue, 06 Jul 2010 12:48:38 -0500
It was downloaded from:
https://sourceforge.net/projects/osra/files/osra/
Upstream Author:
Igor Filippov
Copyright:
Copyright (C) 2007-2013 Igor Filippov
License:
This package 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 package 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
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in "/usr/share/common-licenses/GPL-2".
osra-2.1.3/package/linux/debian/control.in 0000664 0001750 0001750 00000003565 14115175251 017144 0 ustar igor igor Source: @PACKAGE_NAME@
Section: science
Priority: optional
Maintainer: Dmitry Katsubo
Build-Depends: debhelper (>= 9),
cimg-dev (>= 1.2.7),
libc6-dev (>= 2.7),
libstdc++-dev,
libtclap-dev (>= 1.2),
libpotrace-dev (>= 1.8),
libgocr-dev (>= 0.49),
libocrad-dev (>= 0.20),
libopenbabel-dev (>= 2.3),
libgraphicsmagick++1-dev (>= 1.3),
libcuneiform-dev (>= 1.1),
libtesseract-dev (>= 3.01),
java2-sdk,
docbook-xsl (>= 1.74.0),
docbook-xml,
xsltproc,
naturaldocs
Standards-Version: 3.9.6
Homepage: http://osra.sourceforge.net/
XS-Vcs-Svn: https://osra.svn.sourceforge.net/svnroot/osra/
Vcs-browser: http://osra.svn.sourceforge.net/viewvc/osra/
Package: @PACKAGE_NAME@
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, ${binary:Depends}, @PACKAGE_NAME@-common (= ${source:Version})
Recommends: gocr, ocrad, potrace
Description: Command line chemical structure recognition tool (OSRA)
${common:Description}
Package: @PACKAGE_NAME@-common
Architecture: all
Depends: ${misc:Depends}
Description: Shared files for chemical structure recognition tool (OSRA)
${common:Description}
Package: lib@PACKAGE_NAME@@LIB_MAJOR_VERSION@
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, ${binary:Depends}, @PACKAGE_NAME@-common (= ${source:Version})
Description: Chemical structure recognition library (OSRA)
${common:Description}
Package: lib@PACKAGE_NAME@-dev
Architecture: any
Section: libdevel
Depends: ${misc:Depends}, lib@PACKAGE_NAME@@LIB_MAJOR_VERSION@ (= ${binary:Version})
Description: Development headers to consume the OSRA library
${common:Description}
Package: lib@PACKAGE_NAME@-java@LIB_MAJOR_VERSION@
Architecture: any
Section: java
Depends: ${misc:Depends}, ${shlibs:Depends}, ${binary:Depends}, @PACKAGE_NAME@-common (= ${source:Version})
Description: Chemical structure recognition library for Java (OSRA)
${common:Description}
osra-2.1.3/package/linux/debian/osra.install 0000664 0001750 0001750 00000000032 14115175251 017452 0 ustar igor igor /usr/bin
/usr/share/man
osra-2.1.3/package/linux/debian/substvars 0000664 0001750 0001750 00000001237 14115175251 017105 0 ustar igor igor # Note: underscore (_) is not allowed in variable name
binary:Depends=libpotrace0 (>= 1.8), libopenbabel4 (>= 2.3), libgraphicsmagick++3 (>= 1.3), libtesseract3 (>= 3.01), libcuneiform0 (>= 1.1)
common:Description=OSRA is a utility designed to convert graphical representations of chemical${Newline}structures into SMILES or SDF.${Newline}OSRA can read a document in any of the over 90 graphical formats parseable by${Newline}GraphicMagick and generate the SMILES or SDF representation of the molecular${Newline}structure images encountered within that document.${Newline}Authors:${Newline} ${common:Authors}
common:Authors=Igor Filippov
osra-2.1.3/package/linux/debian/rules.in 0000664 0001750 0001750 00000002471 14115175251 016611 0 ustar igor igor #!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk
%:
dh $@
override_dh_auto_configure:
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" dh_auto_configure -- --enable-docs --enable-lib --enable-java --with-tesseract --with-cuneiform --datadir='$${datarootdir}/$${PACKAGE_NAME}' --docdir='$${datarootdir}/doc/$${PACKAGE_NAME}'
override_dh_install:
# Check that *.install files have the same names as expected by debuild:
[ -e debian/@PACKAGE_NAME@.install ] || @LN_S@ osra.install debian/@PACKAGE_NAME@.install
[ -e debian/lib@PACKAGE_NAME@@LIB_MAJOR_VERSION@.install ] || @LN_S@ libosra.install debian/lib@PACKAGE_NAME@@LIB_MAJOR_VERSION@.install
[ -e debian/lib@PACKAGE_NAME@-dev.install ] || @LN_S@ libosra-dev.install debian/lib@PACKAGE_NAME@-dev.install
[ -e debian/lib@PACKAGE_NAME@-java@LIB_MAJOR_VERSION@.install ] || @LN_S@ libosra-java.install debian/lib@PACKAGE_NAME@-java@LIB_MAJOR_VERSION@.install
# Continue with normal operation:
dh_install
# The default file "debian/substvars" is replaced by package-specific "debian/${package}.substvars", so in order not to mess with symlinks, we define an additional file with variable substitution:
override_dh_gencontrol:
dh_gencontrol -- -Tdebian/substvars
osra-2.1.3/package/linux/debian/source/ 0000775 0001750 0001750 00000000000 14115175251 016423 5 ustar igor igor osra-2.1.3/package/linux/debian/source/format 0000664 0001750 0001750 00000000014 14115175251 017631 0 ustar igor igor 3.0 (quilt)
osra-2.1.3/package/linux/debian/libosra-java.install 0000664 0001750 0001750 00000000033 14115175251 021061 0 ustar igor igor /usr/lib/libosra_java.so*
osra-2.1.3/package/linux/install.sh.in 0000775 0001750 0001750 00000001246 14115175251 016316 0 ustar igor igor #!/bin/bash
if (( $EUID != 0 )); then
echo "The installation must be run as root" 1>&2
exit 1
fi
mkdir -p /opt/local/@PACKAGE_NAME@/@PACKAGE_VERSION@ || { echo "Cannot create /opt/local/@PACKAGE_NAME@ folder" 1>&2; exit; }
mkdir -p /usr/local/bin || { echo "Cannot create /usr/local/bin folder" 1>&2; exit; }
cp --remove-destination package/* /opt/local/@PACKAGE_NAME@/@PACKAGE_VERSION@/ || { echo "Cannot copy to /opt/local/@PACKAGE_NAME@ folder" 1>&2; exit; }
echo "Installing binary files in /opt/local/@PACKAGE_NAME@"
cp --remove-destination osra /usr/local/bin || { echo "Cannot copy to /usr/local/bin" 1>&2; exit; }
echo "Installing osra script in /usr/local/bin"
osra-2.1.3/package/linux/osra-pdf 0000775 0001750 0001750 00000024616 14115175252 015354 0 ustar igor igor #!/usr/bin/perl
# This is a script to run OSRA processing on images and PDF files with higher quality output than what is produced with the default options,
# It is expected to be useful mainly for PDF files. It works by running OSRA with multiple combinations of
# image processing options and automatically selecting and filtering for the best possible molecular structure. Be prepared
# that it is much slower than a regular OSRA run. You can modify the option set or the filtering criteria to better suit your needs.
# OpenBabel perl binding are required to run this script.
# Usage: ./osra-pdf input.pdf output.sdf
#
# Igor Filippov, igor.v.filippov@gmail.com
$OSRA = "/usr/local/bin/osra";
@options = (['','-j'],
['', '-u 1','-u 2'],
['', '-r 150']
);
use List::Util qw[min max];
use Chemistry::OpenBabel;
use Statistics::Descriptive;
if ($#ARGV != 1)
{
print "Usage: ".$0." \n";
exit(1);
}
$TAN_MIN = 0.9;
$DIFF = 0.1;
$PREFIX = "/tmp/tmp.osra.output.".$$;
$Chemistry::OpenBabel::obErrorLog->StopLogging();
$num_files = run_osra_with_different_options($OSRA,$ARGV[0],\@options,$PREFIX);
$records = load_all_files($PREFIX,$num_files);
$sdf_after_concat = concat_sd_files($records);
$sdf_after_avg_bond = filter_by_avg_bond($sdf_after_concat);
$sdf_after_props = filter_by_mol_properties($sdf_after_avg_bond);
$sdf_after_filters = keep_unique_mols($sdf_after_props);
save_sd_file($ARGV[1],$sdf_after_filters);
for (my $i=0; $i<$num_files; $i++)
{
unlink($PREFIX.".".$i);
}
exit(0);
sub run_osra_with_different_options($$$$)
{
my $osra = shift;
my $input = shift;
my $options = shift;
my $prefix = shift;
my @default_options = ($osra,$input,"-b","-c","-e","-p", "-f","sdf");
my $stop;
my @current;
my $num_files = 0;
while (!$stop)
{
my @new_options = @default_options;
for (my $i = 0; $i<=$#{$options}; $i++)
{
my $opt = $options->[$i]->[$current[$i]];
my @split_opt = split /\s+/,$opt;
push(@new_options,@split_opt);
}
push (@new_options,'-w',$prefix.".".$num_files);
system(@new_options);
$num_files++;
my $j = $#{$options};
while ($current[$j] == $#{$options->[$j]} && $j>=0) {$j--;}
if ($j>=0)
{
$current[$j]++;
for (my $k = $j+1; $k<=$#{$options}; $k++)
{
$current[$k] = 0;
}
}
else
{
$stop = 1;
}
}
return($num_files);
}
sub load_all_files($$)
{
my $prefix=shift;
my $num_files = shift;
my $obconversion = new Chemistry::OpenBabel::OBConversion;
$obconversion->SetInFormat("sdf");
my $obmol = new Chemistry::OpenBabel::OBMol;
my @records;
# my $i=0;
# for $file (@ARGV)
for (my $i=0; $i<$num_files;$i++)
{
my $file = $prefix.".".$i;
my $j=0;
my $notatend = $obconversion->ReadFile($obmol, $file);
while ($notatend)
{
$records[$i]->[$j++] = new Chemistry::OpenBabel::OBMol($obmol);
$obmol->Clear();
$notatend = $obconversion->Read($obmol);
}
# $i++;
}
return(\@records);
}
sub concat_sd_files($)
{
my $records=shift;
my @done;
my @sdf_after_conctat;
for (my $i1=0; $i1<=$#{$records}; $i1++)
{
for ($j1=0; $j1<= $#{$records->[$i1]}; $j1++)
{
if (!$done[$i1]->[$j1])
{
my $sdf1=$records->[$i1]->[$j1];
my $obdata = $sdf1->GetData("Page");
my $page1 = $obdata->GetValue();
$obdata = $sdf1->GetData("Surrounding_box");
my $box1 = $obdata->GetValue();
$obdata = $sdf1->GetData("Confidence_estimate");
my $conf1 = $obdata->GetValue();
$box1 =~ /(\d+)x(\d+)\-(\d+)x(\d+)/;
my $left1=$1;
my $top1=$2;
my $right1=$3;
my $bottom1=$4;
my $best_conf = $conf1;
my $best_sdf=$sdf1;
for (my $i2=$i1+1; $i2<=$#{$records}; $i2++)
{
for ($j2=0; $j2<= $#{$records->[$i2]}; $j2++)
{
if (!$done[$i2]->[$j2])
{
my $sdf2=$records->[$i2]->[$j2];
my $obdata = $sdf2->GetData("Page");
my $page2 = $obdata->GetValue();
$obdata = $sdf2->GetData("Surrounding_box");
my $box2 = $obdata->GetValue();
$obdata = $sdf2->GetData("Confidence_estimate");
my $conf2 = $obdata->GetValue();
if ($page1 == $page2)
{
$box2 =~ /(\d+)x(\d+)\-(\d+)x(\d+)/;
my $left2=$1;
my $top2=$2;
my $right2=$3;
my $bottom2=$4;
my $overlap = 0;
my $l = max($left1, $left2);
my $r = min($right1,$right2);
my $t = max($top1, $top2);
my $b = min($bottom1, $bottom2);
if (($r > $l) && ($b > $t))
{
$overlap = ($r-$l)*($b-$t);
}
my $area1=($right1-$left1)*($bottom1-$top1);
my $area2=($right2-$left2)*($bottom2-$top2);
if ($right1>$left1 && $right2>$left2 && $bottom1>$top1 && $bottom2>$top2)
{
my $tanimoto = $overlap/($area1+$area2-$overlap);
my $x_rel_diff = abs(($right1-$left1)-($right2-$left2))/min(($right1-$left1),($right2-$left2));
my $y_rel_diff = abs(($bottom1-$top1)-($bottom2-$top2))/min(($bottom1-$top1),($bottom2-$top2));
if ($tanimoto > $TAN_MIN
&& $x_rel_diff<$DIFF && $y_rel_diff<$DIFF)
{
if ($conf2 > $best_conf)
{
$best_conf=$conf2;
$best_sdf=$sdf2;
}
$done[$i2]->[$j2]=1;
}
}
}
}
}
}
push(@sdf_after_concat,$best_sdf);
$done[$i1]->[$j1]=1;
}
}
}
return(\@sdf_after_concat);
}
sub filter_by_avg_bond($)
{
my $sdf_after_concat=shift;
my @arr;
for (my $i=0; $i<=$#{$sdf_after_concat}; $i++)
{
my $sdf = $sdf_after_concat->[$i];
$obdata = $sdf->GetData("Confidence_estimate");
my $conf = $obdata->GetValue();
$obdata = $sdf->GetData("Average_bond_length");
my $avg_bond = $obdata->GetValue();
$arr[$i]->{'conf'}=$conf;
$arr[$i]->{'avg'}=$avg_bond;
}
my $stat = Statistics::Descriptive::Full->new();
@sorted_arr = sort {$b->{'conf'} <=> $a->{'conf'}} @arr;
for (my $i=0; $i<=min($#sorted_arr,max(10,$#sorted_arr/10)); $i++)
{
$stat->add_data($sorted_arr[$i]->{'avg'});
}
my $mean_avg_bond = $stat->mean();
my $dev_avg_bond = $stat->standard_deviation();
my @sdf_after_avg_bond;
for (my $i=0; $i<=$#{$sdf_after_concat}; $i++)
{
if ($arr[$i]->{'avg'} > $mean_avg_bond - 2*$dev_avg_bond &&
$arr[$i]->{'avg'} < $mean_avg_bond + 2*$dev_avg_bond)
{
push(@sdf_after_avg_bond,$sdf_after_concat->[$i]);
}
}
return(\@sdf_after_avg_bond);
}
sub filter_by_mol_properties($)
{
my $sdf_after_avg_bond = shift;
my @sdf_after_filters;
my $obconversion = new Chemistry::OpenBabel::OBConversion;
$obconversion->SetOutFormat("sdf");
for (my $i=0; $i<=$#{$sdf_after_avg_bond}; $i++)
{
my $sdf = $sdf_after_avg_bond->[$i];
my $obdata = $sdf->GetData("Confidence_estimate");
my $conf = $obdata->GetValue();
my $bad_atom_num=0;
my $xx_present=0;
my $num_bad_valence=0;
my $min_bond_angle=180;
my $max_carbon_bond_angle=0;
my $min_exo_angle=180;
for (my $j=1; $j<=$sdf->NumAtoms(); $j++)
{
my $atom = $sdf->GetAtom($j);
my $anum = $atom->GetAtomicNum();
# count atoms not in C N O S F Cl Br I P
if ($anum != 6 && $anum != 7 && $anum != 8 && $anum != 9 &&
$anum != 15 && $anum != 16 && $anum != 17 && $anum != 53
&& $anum != 1 && $anum != 35)
{
$bad_atom_num++;
}
# is Xx present?
my $sdf_string = $obconversion->WriteString($sdf);
if ($sdf_string =~ "Xx")
{
$xx_present = 1;
}
if ($atom->GetValence() > $atom->GetImplicitValence())
{
$num_bad_valence++;
}
my $iter = new Chemistry::OpenBabel::OBAtomAtomIter($atom);
my @neighbor1;
while (my $n = $iter->())
{
push(@neighbor1,$n->GetIdx());
}
for (my $k=0;$k<=$#neighbor1;$k++)
{
my $n = $sdf->GetAtom($neighbor1[$k]);
my $iter2 = new Chemistry::OpenBabel::OBAtomAtomIter($n);
my @neighbor2;
while (my $n2 = $iter2->())
{
push(@neighbor2,$n2->GetIdx());
}
for (my $l=0; $l<=$#neighbor2; $l++)
{
my $n2 = $sdf->GetAtom($neighbor2[$l]);
if ($neighbor2[$l] != $atom->GetIdx())
{
my $angle = abs($sdf->GetAngle($atom,$n,$n2));
if ($angle < $min_bond_angle)
{
$min_bond_angle = $angle;
}
}
if ($#neighbor1==0 && $n->IsInRing() && $n2->IsInRing())
{
my $angle = abs($sdf->GetAngle($atom, $n, $n2));
if ($angle < $min_exo_angle)
{
$min_exo_angle=$angle;
}
}
}
}
if ($atom->GetAtomicNum() == 6 && $#neighbor1 == 1)
{
my $atom1 = $sdf->GetAtom($neighbor1[0]);
my $atom2 = $sdf->GetAtom($neighbor1[1]);
my $bond1 = $sdf->GetBond($atom1,$atom);
my $bond2 = $sdf->GetBond($atom2,$atom);
if ($bond1->IsSingle() && $bond2->IsSingle())
{
my $angle = abs($sdf->GetAngle($atom1, $atom, $atom2));
if ($angle > $max_carbon_bond_angle)
{
$max_carbon_bond_angle = $angle;
}
}
}
}
my $min_bond_length = 10;
my $num_bad_stereo = 0;
for (my $j=0; $j<$sdf->NumBonds(); $j++)
{
my $bond = $sdf->GetBond($j);
my $atom1 = $bond->GetBeginAtom();
my $atom2 = $bond->GetEndAtom();
if ($atom1->GetAtomicNum() != 1 && $atom2->GetAtomicNum() != 1
&& $bond->GetLength() < $min_bond_length)
{
$min_bond_length = $bond->GetLength();
}
if (!$atom1->IsChiral() && $bond->IsWedgeOrHash())
{
$num_bad_stereo++;
}
}
if ($conf>0.4
#&& $bad_atom_num==0
&& $xx_present==0
&& $min_bond_length>0.85
&& $min_bond_angle>10
&& $max_carbon_bond_angle<155
&& $min_exo_angle>50
&& $sdf->NumHvyAtoms()>6
&& $sdf->GetMolWt()<2000
&& $num_bad_stereo==0
&& $num_bad_valence==0)
{
push(@sdf_after_filters,$sdf);
}
}
return(\@sdf_after_filters);
}
sub keep_unique_mols($)
{
my $mols = shift;
my $obconversion = new Chemistry::OpenBabel::OBConversion;
$obconversion->SetOutFormat("inchi");
my %collection;
my @unique;
for (my $i=0; $i<=$#{$mols}; $i++)
{
my $sdf = $mols->[$i];
my $inchi = $obconversion->WriteString($sdf);
if (!$inchi || !$collection{$inchi})
{
push(@unique,$sdf);
if ($inchi)
{
$collection{$inchi} = 1;
}
}
}
return(\@unique);
}
sub save_sd_file($$)
{
my $name = shift;
my $sdf_after_filters = shift;
my $obconversion = new Chemistry::OpenBabel::OBConversion;
$obconversion->SetOutFormat("sdf");
open(OUT,">".$name);
for (my $i=0; $i<=$#{$sdf_after_filters}; $i++)
{
my $sdf = $sdf_after_filters->[$i];
my $output = $obconversion->WriteString($sdf);
print OUT $output;
}
close(OUT);
}
osra-2.1.3/package/linux/osra.pc.in 0000664 0001750 0001750 00000000342 14115175251 015575 0 ustar igor igor prefix=@prefix@
exec_prefix=@exec_prefix@
Name: @PACKAGE_NAME@
Description: Chemical structure recognition library
Version: @PACKAGE_VERSION@
Requires: gocr ocrad openbabel3 GraphicsMagick++
Libs: -l@libdir@ @LIBS@
Cflags:
osra-2.1.3/package/linux/create_model_ga.py 0000775 0001750 0001750 00000017575 14115175252 017370 0 ustar igor igor #!/usr/bin/python
import sys
import operator
from operator import itemgetter
from os import listdir
from os.path import isfile, join
import random
import math
from openbabel import *
#verify_model = [-0.02285364975052934, 0.20014736496836238, 0.24359177367611942, 0.09879557707190285, 0.23658236605437208, 0.07640365396444981, -0.016708707126055426, 0.291372680023203, 0.19743466243758914, -0.04143248625528295, 0.13283691497820155, -0.09404435905499846, -0.34011551678018254, -0.036998642457270414, 0.3366565862477758, 0.2528949626509886, 0.3523503866589532, 0.3013887466571869, 0.2457272087651062, -0.08224552150295372, 0.0386321456632419, 0.2269247796030229, 0.191691888047917, 0.029364205782588967, -0.09207024117341821, 0.024551588143053422]
verify_model = [-0.11469143725730054, 0.15723547931889853, 0.19765680222250673, 0.249101590474403, 0.1897669087341134, 0.19588348907301223, 0.3354622208036507, 0.16779269801176255, -0.21232000222198893, 0.016958281784354032, -0.08672059360133752, -0.05105752296619957, -0.349912750824004, 0.18836317536530647, 0.22316782354758827, 0.27741998968081166, 0.25710999274481955, 0.27968899280120096, 0.12695166847876285, -0.10020778884718293, 0.05150631410596443, 0.22283571763712148, 0.23130179826714167, 0.1049054095759948, 0.05333970810460394, -0.12491056666737535]
#verify_model = [-0.1545855719726278, -0.16679291864636722, 0.2779073764931343, -0.183848833684335, 0.010790075194024773, 0.29094165316568404, 0.055324497605819506, -0.2104820104189514, -0.1781856691338483, 0.12170164214195042, -0.03319968208305941, -0.17050232311223057, -0.3855170942775288, -0.07088710430614285, 0.24005317771967355, 0.2759926472483148, 0.25348276233777095, 0.23427258354038655, -0.1175747967837222, -0.18681840394577787, 0.06103578120099978, 0.24422743725717977, 0.25207495568639754, -0.09625789745569688, -0.01025153552468599, 0.19182292957981223]
#verify_model = [-0.18431997080588122, -0.13632503439995766, 0.2891372503939111, 0.169268288671698, 0.07457361791041998, 0.1896239880096002, 0.17921064798323905, 0.24807741146917148, -0.1415236210886208, 0.017500171104361622, -0.1444618582502517, -0.019936025471384962, -0.39685240156986173, -0.22908080638789957, 0.27059782240339336, 0.17386007711539425, 0.21106985232185135, 0.2865651377997317, 0.09715634915474097, 0.008962730235627716, 0.030950650868271857, 0.2256707621011711, 0.19237430308515277, -0.22938527889531524, 0.15229124226660562, 0.2099925925427031]
def normalize(x):
n = sum(map( operator.mul, x, x))
n = math.sqrt(n)
y = [a/n for a in x]
return y
def trial_confidence(x,c):
return sum(map( operator.mul, x, c))
def model_recall(N,res_iter_all,probabilities,target,inchi_list,total):
recall_model = 0
k = 0
for i in range(N):
total_probabilities = [0.,0.,0.,0.,0.]
n_probabilities = [0.,0.,0.,0.,0.]
recall_inchi = set()
for r in range(0,5):
for j in range(len(res_iter_all[i])):
if (res_iter_all[i][j] == r):
total_probabilities[r] += probabilities[k+j]
n_probabilities[r] += 1
maxp = 0
maxr = 0
for r in range(0,5):
if (n_probabilities[r]>0 and maxp < total_probabilities[r]/n_probabilities[r]):
maxp = total_probabilities[r]/n_probabilities[r]
maxr = r
first = True
for r in range(0,5):
if (n_probabilities[r]>0 and maxp == total_probabilities[r]/n_probabilities[r] and (r == 2 or r == 3) and first):
maxr = r
first = False
for j in range(len(res_iter_all[i])):
if (res_iter_all[i][j] == maxr and target[k+j] == 1):
recall_inchi.add(inchi_list[k+j])
k += len(res_iter_all[i])
recall_model += len(recall_inchi);
return 1.*recall_model/total
def mutation(n):
d = []
for i in range(n):
d.append(2.*random.random()-1.)
return normalize(d)
def crossover(population):
n = len(population)
i = random.randint(0,n-1)
j = random.randint(0,n-1)
v = population[i][1]
u = population[j][1]
m = random.randint(0,len(v)-1)
r = v[:m]
r.extend(u[m:])
return normalize(r)
obconversion1 = OBConversion()
obconversion1.SetInFormat("sdf")
obconversion1.SetOutFormat("inchi")
obmol1 = OBMol()
obconversion2 = OBConversion()
obconversion2.SetInFormat("sdf")
obconversion2.SetOutFormat("inchi")
obmol2 = OBMol()
result = OBPlugin.ListAsString("fingerprints")
assert "FP2" in result, result
fingerprinter = OBFingerprint.FindFingerprint("FP2")
v1 = vectorUnsignedInt()
v2 = vectorUnsignedInt()
obErrorLog.StopLogging()
path1 = sys.argv[1]
path2 = sys.argv[2]
files = [ f for f in listdir(path1) if isfile(join(path1,f)) ]
total = 0;
recall = 0;
target = []
train = []
confidence = []
resolutions = []
single = []
res_iter_all = []
probabilities = []
inchi_list = []
for f in files:
file1 = join(path1,f);
inchi_set1 = set()
notatend1 = obconversion1.ReadFile(obmol1,file1)
while notatend1:
obmol1.AddHydrogens()
inchi1 = obconversion1.WriteString(obmol1)
if inchi1:
inchi_set1.add(inchi1)
total += 1;
obmol1 = OBMol()
notatend1 = obconversion1.Read(obmol1)
file2 = join(path2,f);
inchi_set2 = set()
if isfile(file2):
notatend2 = obconversion2.ReadFile(obmol2,file2)
data_file = []
resolution = []
res_iter = []
while notatend2:
obmol2.AddHydrogens()
line = obmol2.GetData("Confidence_parameters").GetValue()
data = [int(d) for d in line.split(",")]
data_file.append(data)
inchi2 = obconversion2.WriteString(obmol2)
result = 0
if inchi2:
inchi_set2.add(inchi2)
if inchi2 in inchi_set1:
result = 1
target.append(result)
inchi_list.append(inchi2);
resolution.append(int(obmol2.GetData("Resolution").GetValue()))
res_iter.append(int(obmol2.GetData("Resolution_iteration").GetValue()))
obmol2 = OBMol()
notatend2 = obconversion2.Read(obmol2)
resolutions.append(resolution)
res_iter_all.append(res_iter)
for d in data_file:
train.append(d)
recall += len(inchi_set1.intersection(inchi_set2))
N = len(files);
ideal_recall = 1.*recall/total
print "Ideal: ",ideal_recall
population = []
if len(sys.argv)>3 and sys.argv[3] == "-verify":
c = verify_model
probabilities = []
for t in train:
probabilities.append(trial_confidence(t,c))
r = model_recall(N,res_iter_all,probabilities,target,inchi_list,total)
print "Model: ",r
exit(0)
for i in range(100):
c = mutation(len(train[0]))
probabilities = []
for t in train:
probabilities.append(trial_confidence(t,c))
r = model_recall(N,res_iter_all,probabilities,target,inchi_list,total)
population.append([r,c])
population.sort(key=itemgetter(0),reverse=True)
round = 1
print round,population[0][0]
while population[0][0] < ideal_recall - 0.001 and round < 1000:
# keep top 10
new_population = population[0:10]
# mutation 10
for i in range(10):
c = mutation(len(train[0]))
probabilities = []
for t in train:
probabilities.append(trial_confidence(t,c))
r = model_recall(N,res_iter_all,probabilities,target,inchi_list,total)
new_population.append([r,c])
# crossover 80
for i in range(80):
c = crossover(population)
probabilities = []
for t in train:
probabilities.append(trial_confidence(t,c))
r = model_recall(N,res_iter_all,probabilities,target,inchi_list,total)
new_population.append([r,c])
new_population.sort(key=itemgetter(0),reverse=True)
population = new_population
round += 1
print round,population[0][0]
print population[0][1]
osra-2.1.3/package/linux/plugins/ 0000775 0001750 0001750 00000000000 14115175251 015362 5 ustar igor igor osra-2.1.3/package/linux/plugins/bkchem/ 0000775 0001750 0001750 00000000000 14115175252 016614 5 ustar igor igor osra-2.1.3/package/linux/plugins/bkchem/convert_clipboard_image.xml 0000664 0001750 0001750 00000000744 14115175252 024204 0 ustar igor igor
Noel M. O'Boyle, Igor V. Filippov
Takes an image of a molecule from the clipboard and converts it using OSRA (you need to install OSRA
and set the environment variable OSRA to point to the executable)
convert_clipboard_image.py
Convert Image To Mol
osra-2.1.3/package/linux/plugins/bkchem/convert_clipboard_image.py 0000664 0001750 0001750 00000007220 14115175252 024030 0 ustar igor igor """Authors: Noel O'Boyle and Igor V. Filippov
Copied of......hmmm... Inspired by the "fetch from webbook" plugin :-)
Converts an image from clipboard to a molecule using OSRA
"""
import os
import popen2
import oasa_bridge
import dialogs
import tempfile
import Pmw
import StringIO
import os, sys
def err_mess_box(mess, title="Error"): #Pops up error OK-box
message = ""
for m in mess:
message=message+m+"\n"
dialog = Pmw.Dialog(App.paper, buttons=('OK',),
defaultbutton='OK', title=title)
w = Pmw.LabeledWidget(dialog.interior(), labelpos='n', label_text=message)
w.pack(expand=1, fill='both', padx=4, pady=4)
dialog.activate()
def run_osra(osra):
sdf = " "
filedes, filename = tempfile.mkstemp(suffix='.png')
if os.name=="posix":
import pygtk
pygtk.require('2.0')
import gtk, gobject
clipboard = gtk.clipboard_get()
image=clipboard.wait_for_image()
if not image:
return sdf
try:
image.save(filename,"png")
except:
return sdf
else:
import ImageGrab
image = ImageGrab.grabclipboard()
if not image:
return sdf
try:
image.save(filename)
except:
return sdf
try:
stdout, stdin, stderr = popen2.popen3('"%s" -f sdf %s' % (osra, filename))
except:
os.remove(filename)
return sdf
sdf = stdout.read()
#os.remove(filename)
return sdf
def present_mol(sdf):
if not sdf.rstrip().endswith("$$$$"):
return 0
try:
mol = StringIO.StringIO(sdf)
molec = oasa_bridge.read_molfile(mol, App.paper)
mol.close()
except:
return 0
if len(molec.atoms)<2:
return 0
averagey = sum([atom.y for atom in molec.atoms]) / float(len(molec.atoms))
for atom in molec.atoms:
atom.y = 2*averagey - atom.y
N = 0
for minimol in molec.get_disconnected_subgraphs():
N += 1
App.paper.stack.append(minimol)
minimol.draw()
App.paper.add_bindings()
App.paper.start_new_undo_record()
return N
osra = os.environ.get("OSRA", None)
if osra and os.path.isfile(osra):
if os.name=="posix":
r, w = os.pipe() # these are file descriptors, not file objects
pid = os.fork()
if pid:
# we are the parent
os.close(w) # use os.close() to close a file descriptor
r = os.fdopen(r) # turn r into a file object
dialog = dialogs.progress_dialog(App, title="Progress")
dialog.update(0.1, top_text = "Calling OSRA...", bottom_text = "Image processing in progress")
sdf = r.read()
dialog.update(0.9, top_text = "Adding molecules to workspace...", bottom_text = "Almost there!")
N = present_mol(sdf)
dialog.close()
if N<1:
err_mess_box(["Image could not be converted to a molecule."])
# else:
# err_mess_box(["%d molecule%s added" % (N, ["s", ""][N==1])], "Info")
os.waitpid(pid, 0) # make sure the child process gets cleaned up
else:
# we are the child
os.close(r)
w = os.fdopen(w, 'w')
sdf = run_osra(osra)
w.write(sdf)
w.close()
sys.exit(0)
else:
dialog = dialogs.progress_dialog(App, title="Progress")
dialog.update(0.1, top_text = "Calling OSRA...", bottom_text = "Image processing in progress")
sdf = run_osra(osra)
dialog.update(0.9, top_text = "Adding molecules to workspace...", bottom_text = "Almost there!")
N = present_mol(sdf)
dialog.close()
if N<1:
err_mess_box(["Image could not be converted to a molecule."])
# else:
# err_mess_box(["%d molecule%s added" % (N, ["s", ""][N==1])], "Info")
else:
err_mess_box(["You need to set the environment variable " \
"OSRA to point to the OSRA executable.\n" \
"When setting the variable, do not include quotation " \
"marks around the path."])
osra-2.1.3/package/linux/INSTALL 0000664 0001750 0001750 00000000412 14115175251 014727 0 ustar igor igor To install run (as a root or via sudo)
./install.sh
It will copy the contents of "package" into /opt/local/osra
and the wrap-around shell script "osra" into /usr/local/bin
Starting with version 2.1.0 Ghostscript is no longer necessary
to process PDF and PS files.
osra-2.1.3/package/linux/INSTALL-user 0000664 0001750 0001750 00000000262 14115175251 015706 0 ustar igor igor To install run
./install.sh
It will copy the contents of "package" into $HOME/osra
Starting with version 2.1.0 Ghostscript is no longer necessary
to process PDF and PS files.
osra-2.1.3/package/linux/osra.sh.in 0000775 0001750 0001750 00000000102 14115175251 015602 0 ustar igor igor #!/bin/sh
/opt/local/@PACKAGE_NAME@/@PACKAGE_VERSION@/osra-bin $*
osra-2.1.3/configure 0000775 0001750 0001750 00001060156 14115175251 013067 0 ustar igor igor #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for osra 2.1.3.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='osra'
PACKAGE_TARNAME='osra'
PACKAGE_VERSION='2.1.3'
PACKAGE_STRING='osra 2.1.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# 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='LTLIBOBJS
LIBOBJS
PACKAGE_VERSION_WITH_DASHES
resolved_datadir
SHAREDEXT
LDSHAREDFLAGS
LIB_PATCH_VERSION
GRAPHICS_MAGICK_CONFIG
TESSERACT_LIB
OSRA_JAVA
EGREP
GREP
CXXCPP
OSRA_LIB
OPENMP_CXXFLAGS
XSLTPROC
NATURALDOCS
RANLIB
AR
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
LN_S
RM
HAVE_CXX11
OBJEXT
EXEEXT
ac_ct_CXX
CPPFLAGS
LDFLAGS
CXXFLAGS
CXX
LD
build_os
build_vendor
build_cpu
build
LIB_MINOR_VERSION
LIB_MAJOR_VERSION
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_docs
enable_openmp
enable_static_linking
enable_profiling
with_macports
enable_lib
enable_java
with_tclap_include
with_potrace_include
with_potrace_lib
with_gocr_include
with_gocr_lib
with_ocrad_include
with_ocrad_lib
with_poppler_include
with_poppler_lib
with_tesseract_include
with_tesseract
with_tesseract_lib
with_cuneiform
with_cuneiform_include
with_cuneiform_lib
with_openbabel_include
with_openbabel_lib
enable_graphicsmagick_config
with_graphicsmagick_include
with_graphicsmagick_lib
'
ac_precious_vars='build_alias
host_alias
target_alias
CXX
CXXFLAGS
LDFLAGS
LIBS
CPPFLAGS
CCC
CXXCPP'
# 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 osra 2.1.3 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/osra]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
System types:
--build=BUILD configure for building on BUILD [guessed]
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of osra 2.1.3:";;
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-docs Enable generating of documentation (man pages, API
reference, etc)
--enable-openmp Enable OpenMP extensions for compilers that support
it
--disable-openmp do not use OpenMP
--enable-static-linking Try to link all libraries statically (fallback to
dynamic linking if statis was not found) (GCC-only)
--enable-profiling Include verbose profiling/debugging information into
the binary
--enable-lib Include building of OSRA dynamic (.so) and static
(.a) library into build cycle.
--enable-java Include Java JNI bridge compilation into build
cycle. Make sure you have JDK installed and
JAVA_HOME environment variable pointing to its
location or jni.h is in compiler search path.
--disable-graphicsmagick-config
Disable use of GraphicsMagick++-config for library
linking
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-macports Alternative location for MacPorts libraries on OS X
(default: /opt/local/lib)
--with-tclap-include custom location of tclap/CmdLine.h from TCLAP
(Templatized C++ Command Line Parser Library), see
http://tclap.sourceforge.net/ (default: "auto")
--with-potrace-include custom location of potracelib.h from POTRACE (vector
tracing library), see
http://potrace.sourceforge.net/ (default: "auto")
--with-potrace-lib custom location of the library
--with-gocr-include custom location of gocr/pgm2asc.h from GOCR (optical
character recognition library), see
http://jocr.sourceforge.net/ (default:
"/usr/include/gocr /usr/local/include/gocr auto")
--with-gocr-lib custom location of the library
--with-ocrad-include custom location of ocradlib.h from OCRAD (optical
character recognition program), see
http://www.gnu.org/software/ocrad/ocrad.html
(default: "auto")
--with-ocrad-lib custom location of the library
--with-poppler-include custom location of poppler/cpp/poppler-document.h
from POPPLER, see http://poppler.freedesktop.org/
(default: "auto")
--with-poppler-lib custom location of the library
--with-tesseract-include
Location of tesseract/baseapi.h header file
--with-tesseract Enable optional support for Tesseract (OCR Engine
developed at HP Labs), see
http://code.google.com/p/tesseract-ocr/ (optional)
(default: "auto")
--with-tesseract-include
Enable optional support for Tesseract (OCR Engine
developed at HP Labs), see
http://code.google.com/p/tesseract-ocr/ (default:
"auto")
--with-tesseract-lib custom location of the library
--with-cuneiform Enable optional support for Cuneiform (OCR system
developed by Cognitive technologies), see
https://launchpad.net/cuneiform-linux (optional)
(default: "auto")
--with-cuneiform-include
Enable optional support for Cuneiform (OCR system
developed by Cognitive technologies), see
https://launchpad.net/cuneiform-linux (default:
"auto")
--with-cuneiform-lib custom location of the library
--with-openbabel-include
custom location of openbabel/builder.h from
OpenBabel (open source chemistry toolbox), see
http://openbabel.sourceforge.net/wiki/Main_Page
(default: "/usr/include/openbabel3
/usr/local/include/openbabel3")
--with-openbabel-lib custom location of the library
--with-graphicsmagick-include
custom location of Magick++.h from GraphicsMagick
(image manipulation library), see
http://www.graphicsmagick.org/ (default:
"/usr/include/GraphicsMagick
/usr/local/include/GraphicsMagick")
--with-graphicsmagick-lib
custom location of the library
Some influential environment variables:
CXX C++ compiler command
CXXFLAGS 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
CXXCPP C++ preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
osra configure 2.1.3
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_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_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_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_check_header_mongrel LINENO HEADER VAR INCLUDES
# ---------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_cxx_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_header_compiler=yes
else
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <$2>
_ACEOF
if ac_fn_cxx_try_cpp "$LINENO"; then :
ac_header_preproc=yes
else
ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
yes:no: )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
no:yes:* )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_header_mongrel
# 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_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_cxx_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_cxx_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_cxx_check_header_compile
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 osra $as_me 2.1.3, 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
LIB_MAJOR_VERSION=2
LIB_MINOR_VERSION=1
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
case "$build_os" in #(
linux*) :
build_os="linux" ;; #(
darwin*) :
build_os="darwin" ;; #(
mingw*) :
build_os="mingw" ;; #(
*) :
;;
esac
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
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; 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_LD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $LD in
[\\/]* | ?:[\\/]*)
ac_cv_path_LD="$LD" # 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_LD="$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
LD=$ac_cv_path_LD
if test -n "$LD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
$as_echo "$LD" >&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 if ld ($LD) is GNU ld" >&5
$as_echo_n "checking if ld ($LD) is GNU ld... " >&6; }
if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then :
$as_echo yes
ac_gnu_ld=yes
else
$as_echo no
ac_gnu_ld=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
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
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_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
ax_cxx_compile_cxx11_required=false
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_success=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
if ${ax_cv_cxx_compile_cxx11+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check single_type;
typedef check> double_type;
typedef check>> triple_type;
typedef check>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same::value == true, "");
static_assert(is_same::value == false, "");
static_assert(is_same::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same::value == true, "");
static_assert(is_same::value == true, "");
static_assert(is_same::value == true, "");
static_assert(is_same::value == false, "");
static_assert(is_same::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template
struct sum;
template
struct sum
{
static constexpr auto value = N0 + sum::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template
using member = typename T::member_type;
template
void func(...) {}
template
void func(member*) {}
void test();
void test() { func(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ax_cv_cxx_compile_cxx11=yes
else
ax_cv_cxx_compile_cxx11=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
$as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
if test x$ax_cv_cxx_compile_cxx11 = xyes; then
ac_success=yes
fi
if test x$ac_success = xno; then
for switch in -std=gnu++11 -std=gnu++0x; do
cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
if eval \${$cachevar+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_CXX="$CXX"
CXX="$CXX $switch"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check single_type;
typedef check> double_type;
typedef check>> triple_type;
typedef check>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same::value == true, "");
static_assert(is_same::value == false, "");
static_assert(is_same::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same::value == true, "");
static_assert(is_same::value == true, "");
static_assert(is_same::value == true, "");
static_assert(is_same::value == false, "");
static_assert(is_same::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template
struct sum;
template
struct sum
{
static constexpr auto value = N0 + sum::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template
using member = typename T::member_type;
template
void func(...) {}
template
void func(member*) {}
void test();
void test() { func(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
eval $cachevar=yes
else
eval $cachevar=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXX="$ac_save_CXX"
fi
eval ac_res=\$$cachevar
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
ac_success=yes
break
fi
done
fi
if test x$ac_success = xno; then
for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do
cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
if eval \${$cachevar+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_CXX="$CXX"
CXX="$CXX $switch"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check single_type;
typedef check> double_type;
typedef check>> triple_type;
typedef check>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same::value == true, "");
static_assert(is_same::value == false, "");
static_assert(is_same::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same::value == true, "");
static_assert(is_same::value == true, "");
static_assert(is_same::value == true, "");
static_assert(is_same::value == false, "");
static_assert(is_same::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template
struct sum;
template
struct sum
{
static constexpr auto value = N0 + sum::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template
using member = typename T::member_type;
template
void func(...) {}
template
void func(member*) {}
void test();
void test() { func(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
eval $cachevar=yes
else
eval $cachevar=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXX="$ac_save_CXX"
fi
eval ac_res=\$$cachevar
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
ac_success=yes
break
fi
done
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test x$ax_cxx_compile_cxx11_required = xtrue; then
if test x$ac_success = xno; then
as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
fi
fi
if test x$ac_success = xno; then
HAVE_CXX11=0
{ $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
else
HAVE_CXX11=1
$as_echo "#define HAVE_CXX11 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler implements namespaces" >&5
$as_echo_n "checking whether the compiler implements namespaces... " >&6; }
if ${ac_cv_cxx_namespaces+:} false; then :
$as_echo_n "(cached) " >&6
else
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
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
namespace Outer { namespace Inner { int i = 0; }}
int
main ()
{
using namespace Outer::Inner; return i;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_cxx_namespaces=yes
else
ac_cv_cxx_namespaces=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_namespaces" >&5
$as_echo "$ac_cv_cxx_namespaces" >&6; }
if test "$ac_cv_cxx_namespaces" = yes; then
$as_echo "#define HAVE_NAMESPACES /**/" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports Standard Template Library" >&5
$as_echo_n "checking whether the compiler supports Standard Template Library... " >&6; }
if ${ac_cv_cxx_have_stl+:} false; then :
$as_echo_n "(cached) " >&6
else
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
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#ifdef HAVE_NAMESPACES
using namespace std;
#endif
int
main ()
{
list x; x.push_back(5);
list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_cxx_have_stl=yes
else
ac_cv_cxx_have_stl=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_stl" >&5
$as_echo "$ac_cv_cxx_have_stl" >&6; }
if test "$ac_cv_cxx_have_stl" = yes; then
$as_echo "#define HAVE_STL /**/" >>confdefs.h
fi
if test "${ac_cv_cxx_have_stl}" != "yes"; then :
as_fn_error $? "STL was not found; make sure you have installed libstdc++-dev package or check config.log" "$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
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
# Extract the first word of "rm", so it can be a program name with args.
set dummy rm; 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_RM+:} false; then :
$as_echo_n "(cached) " >&6
else
case $RM in
[\\/]* | ?:[\\/]*)
ac_cv_path_RM="$RM" # 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_RM="$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
RM=$ac_cv_path_RM
if test -n "$RM"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5
$as_echo "$RM" >&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 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 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'
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; 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_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
case $AR in
[\\/]* | ?:[\\/]*)
ac_cv_path_AR="$AR" # 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_AR="$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
AR=$ac_cv_path_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
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
# Check whether --enable-docs was given.
if test "${enable_docs+set}" = set; then :
enableval=$enable_docs;
# Extract the first word of "naturaldocs", so it can be a program name with args.
set dummy naturaldocs; 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_NATURALDOCS+:} false; then :
$as_echo_n "(cached) " >&6
else
case $NATURALDOCS in
[\\/]* | ?:[\\/]*)
ac_cv_path_NATURALDOCS="$NATURALDOCS" # 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_NATURALDOCS="$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
NATURALDOCS=$ac_cv_path_NATURALDOCS
if test -n "$NATURALDOCS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NATURALDOCS" >&5
$as_echo "$NATURALDOCS" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "${NATURALDOCS}"; then :
# Extract the first word of "NaturalDocs", so it can be a program name with args.
set dummy NaturalDocs; 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_NATURALDOCS+:} false; then :
$as_echo_n "(cached) " >&6
else
case $NATURALDOCS in
[\\/]* | ?:[\\/]*)
ac_cv_path_NATURALDOCS="$NATURALDOCS" # 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_NATURALDOCS="$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
NATURALDOCS=$ac_cv_path_NATURALDOCS
if test -n "$NATURALDOCS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NATURALDOCS" >&5
$as_echo "$NATURALDOCS" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
# Extract the first word of "xsltproc", so it can be a program name with args.
set dummy xsltproc; 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_XSLTPROC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $XSLTPROC in
[\\/]* | ?:[\\/]*)
ac_cv_path_XSLTPROC="$XSLTPROC" # 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_XSLTPROC="$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
XSLTPROC=$ac_cv_path_XSLTPROC
if test -n "$XSLTPROC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
$as_echo "$XSLTPROC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "${XSLTPROC}"; then :
as_fn_error $? "xsltproc executable was not found; make sure you have installed xsltproc package" "$LINENO" 5
fi
fi
if test -d "/usr/local/include"; then :
CPPFLAGS="-I/usr/local/include ${CPPFLAGS}"
fi
if test -d "/usr/local/lib"; then :
LDFLAGS="-L/usr/local/lib ${LDFLAGS}"
fi
if test -d "/opt/local/lib"; then :
MACPORTSLIBS="/opt/local/lib"
fi
# Check whether --enable-openmp was given.
if test "${enable_openmp+set}" = set; then :
enableval=$enable_openmp;
fi
if test -z "${enable_openmp}" -a "$build_os" == "linux"; then :
enable_openmp=yes
fi
if test "${enable_openmp}" == "yes"; then :
OPENMP_CXXFLAGS=
# Check whether --enable-openmp was given.
if test "${enable_openmp+set}" = set; then :
enableval=$enable_openmp;
fi
if test "$enable_openmp" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CXX option to support OpenMP" >&5
$as_echo_n "checking for $CXX option to support OpenMP... " >&6; }
if ${ac_cv_prog_cxx_openmp+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef _OPENMP
choke me
#endif
#include
int main () { return omp_get_num_threads (); }
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_prog_cxx_openmp='none needed'
else
ac_cv_prog_cxx_openmp='unsupported'
for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \
-Popenmp --openmp; do
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $ac_option"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef _OPENMP
choke me
#endif
#include
int main () { return omp_get_num_threads (); }
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_prog_cxx_openmp=$ac_option
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CXXFLAGS=$ac_save_CXXFLAGS
if test "$ac_cv_prog_cxx_openmp" != unsupported; then
break
fi
done
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_prog_cxx_openmp" >&5
$as_echo "$ac_cv_prog_cxx_openmp" >&6; }
case $ac_cv_prog_cxx_openmp in #(
"none needed" | unsupported)
;; #(
*)
OPENMP_CXXFLAGS=$ac_cv_prog_cxx_openmp ;;
esac
fi
fi
# Check whether --enable-static-linking was given.
if test "${enable_static_linking+set}" = set; then :
enableval=$enable_static_linking;
LDFLAGS="${LDFLAGS} -static-libgcc"
if test "${ac_gnu_ld}" == "yes"; then :
LDFLAGS="${LDFLAGS} -Wl,-static"
fi
fi
# Check whether --enable-profiling was given.
if test "${enable_profiling+set}" = set; then :
enableval=$enable_profiling;
LDFLAGS="-pg ${LDFLAGS}"
CXXFLAGS="-Wall -g3 -pg ${CXXFLAGS}"
else
INSTALL_PROGRAM="${INSTALL_PROGRAM} -s"
fi
# Check whether --with-macports was given.
if test "${with_macports+set}" = set; then :
withval=$with_macports; MACPORTSLIBS="$withval"
fi
# Check whether --enable-lib was given.
if test "${enable_lib+set}" = set; then :
enableval=$enable_lib;
OSRA_LIB=yes
fi
# Check whether --enable-java was given.
if test "${enable_java+set}" = set; then :
enableval=$enable_java;
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
{ $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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_EGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
#include
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_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_cxx_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_cxx_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
if test "${enable_java}" == "yes"; then :
if test -n "${JAVA_HOME}"; then :
CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/win32 -I${JAVA_HOME}/include/darwin ${CPPFLAGS}"
else
CPPFLAGS="-I/usr/lib/jvm/default-java/include ${CPPFLAGS}"
fi
case "$build_os" in #(
cygwin | mingw) :
$as_echo "#define __int64 long long" >>confdefs.h
;; #(
*) :
;;
esac
ac_fn_cxx_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default"
if test "x$ac_cv_header_jni_h" = xyes; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
JNIEnv *j_env;
jobjectArray j_obj_arr;
jbyteArray j_byte_arr;
jstring j_str;
jboolean j_output_confidence;
j_env->GetArrayLength(j_byte_arr);
j_env->GetObjectArrayElement(j_obj_arr, 0);
j_env->GetByteArrayElements(j_byte_arr, NULL);
j_env->ReleaseByteArrayElements(j_byte_arr, (jbyte*) NULL, JNI_ABORT);
j_env->GetStringUTFChars(j_str, NULL);
j_env->ReleaseStringUTFChars(j_str, (const char *) NULL);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
OSRA_JAVA=yes
else
as_fn_error $? "Java JNI bridge support was requested, but failed because JNI API is not supported" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
as_fn_error $? "Java JNI bridge support was requested, but failed because \"jni.h\" was not found (search path: ${CPPFLAGS})" "$LINENO" 5
fi
fi
# Check whether --with-tclap-include was given.
if test "${with_tclap_include+set}" = set; then :
withval=$with_tclap_include;
with_tclap="${with_tclap_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_tclap_include="auto"
fi
if test "${with_tclap_include}" == "no"; then :
as_fn_error $? "The library tclap is obligatory. You cannot disable it." "$LINENO" 5
fi
for ac_header in tclap/CmdLine.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "tclap/CmdLine.h" "ac_cv_header_tclap_CmdLine_h" "$ac_includes_default"
if test "x$ac_cv_header_tclap_CmdLine_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TCLAP_CMDLINE_H 1
_ACEOF
ac_lib_tclap=yes
else
ac_lib_tclap=no
fi
done
if test "${ac_lib_tclap}" != "yes" -a "${with_tclap}" != ""; then :
for ax_var in tclap/CmdLine.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_tclap}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/tclap-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking tclap for tclap/CmdLine.h in ${ac_location}" >&5
$as_echo_n "checking tclap for tclap/CmdLine.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in tclap/CmdLine.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "tclap/CmdLine.h" "ac_cv_header_tclap_CmdLine_h" "$ac_includes_default"
if test "x$ac_cv_header_tclap_CmdLine_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TCLAP_CMDLINE_H 1
_ACEOF
ac_lib_tclap=yes
else
ac_lib_tclap=no
fi
done
if test "${ac_lib_tclap}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in tclap/CmdLine.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking tclap for tclap/CmdLine.h in ${ac_test_location}" >&5
$as_echo_n "checking tclap for tclap/CmdLine.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in tclap/CmdLine.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "tclap/CmdLine.h" "ac_cv_header_tclap_CmdLine_h" "$ac_includes_default"
if test "x$ac_cv_header_tclap_CmdLine_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TCLAP_CMDLINE_H 1
_ACEOF
ac_lib_tclap=yes
else
ac_lib_tclap=no
fi
done
if test "${ac_lib_tclap}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in tclap/CmdLine.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_tclap}" != "yes"; then :
as_fn_error $? "tclap/CmdLine.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
# Check whether --with-potrace-include was given.
if test "${with_potrace_include+set}" = set; then :
withval=$with_potrace_include;
with_potrace="${with_potrace_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_potrace="auto"
fi
if test "${with_potrace}" == "no"; then :
as_fn_error $? "The library potrace is obligatory. You cannot disable it." "$LINENO" 5
fi
# Check whether --with-potrace-lib was given.
if test "${with_potrace_lib+set}" = set; then :
withval=$with_potrace_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in potracelib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "potracelib.h" "ac_cv_header_potracelib_h" "$ac_includes_default"
if test "x$ac_cv_header_potracelib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_POTRACELIB_H 1
_ACEOF
ac_lib_potrace=yes
else
ac_lib_potrace=no
fi
done
if test "${ac_lib_potrace}" != "yes" -a "${with_potrace}" != ""; then :
for ax_var in potracelib.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_potrace}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/potrace-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking potrace for potracelib.h in ${ac_location}" >&5
$as_echo_n "checking potrace for potracelib.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in potracelib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "potracelib.h" "ac_cv_header_potracelib_h" "$ac_includes_default"
if test "x$ac_cv_header_potracelib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_POTRACELIB_H 1
_ACEOF
ac_lib_potrace=yes
else
ac_lib_potrace=no
fi
done
if test "${ac_lib_potrace}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in potracelib.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking potrace for potracelib.h in ${ac_test_location}" >&5
$as_echo_n "checking potrace for potracelib.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in potracelib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "potracelib.h" "ac_cv_header_potracelib_h" "$ac_includes_default"
if test "x$ac_cv_header_potracelib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_POTRACELIB_H 1
_ACEOF
ac_lib_potrace=yes
else
ac_lib_potrace=no
fi
done
if test "${ac_lib_potrace}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in potracelib.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_potrace}" != "yes"; then :
as_fn_error $? "potracelib.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
# Check whether --with-gocr-include was given.
if test "${with_gocr_include+set}" = set; then :
withval=$with_gocr_include;
with_gocr="${with_gocr_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_gocr="/usr/include/gocr /usr/local/include/gocr auto"
fi
if test "${with_gocr}" == "no"; then :
as_fn_error $? "The library gocr is obligatory. You cannot disable it." "$LINENO" 5
fi
# Check whether --with-gocr-lib was given.
if test "${with_gocr_lib+set}" = set; then :
withval=$with_gocr_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in pgm2asc.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "pgm2asc.h" "ac_cv_header_pgm2asc_h" "$ac_includes_default"
if test "x$ac_cv_header_pgm2asc_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PGM2ASC_H 1
_ACEOF
ac_lib_gocr=yes
else
ac_lib_gocr=no
fi
done
if test "${ac_lib_gocr}" != "yes" -a "${with_gocr}" != ""; then :
for ax_var in pgm2asc.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_gocr}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/gocr-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gocr for pgm2asc.h in ${ac_location}" >&5
$as_echo_n "checking gocr for pgm2asc.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in pgm2asc.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "pgm2asc.h" "ac_cv_header_pgm2asc_h" "$ac_includes_default"
if test "x$ac_cv_header_pgm2asc_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PGM2ASC_H 1
_ACEOF
ac_lib_gocr=yes
else
ac_lib_gocr=no
fi
done
if test "${ac_lib_gocr}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in pgm2asc.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gocr for pgm2asc.h in ${ac_test_location}" >&5
$as_echo_n "checking gocr for pgm2asc.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in pgm2asc.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "pgm2asc.h" "ac_cv_header_pgm2asc_h" "$ac_includes_default"
if test "x$ac_cv_header_pgm2asc_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PGM2ASC_H 1
_ACEOF
ac_lib_gocr=yes
else
ac_lib_gocr=no
fi
done
if test "${ac_lib_gocr}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in pgm2asc.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_gocr}" != "yes"; then :
as_fn_error $? "pgm2asc.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
# Check whether --with-ocrad-include was given.
if test "${with_ocrad_include+set}" = set; then :
withval=$with_ocrad_include;
with_ocrad="${with_ocrad_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_ocrad="auto"
fi
if test "${with_ocrad}" == "no"; then :
as_fn_error $? "The library ocrad is obligatory. You cannot disable it." "$LINENO" 5
fi
# Check whether --with-ocrad-lib was given.
if test "${with_ocrad_lib+set}" = set; then :
withval=$with_ocrad_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in ocradlib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "ocradlib.h" "ac_cv_header_ocradlib_h" "$ac_includes_default"
if test "x$ac_cv_header_ocradlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_OCRADLIB_H 1
_ACEOF
ac_lib_ocrad=yes
else
ac_lib_ocrad=no
fi
done
if test "${ac_lib_ocrad}" != "yes" -a "${with_ocrad}" != ""; then :
for ax_var in ocradlib.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_ocrad}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/ocrad-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ocrad for ocradlib.h in ${ac_location}" >&5
$as_echo_n "checking ocrad for ocradlib.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in ocradlib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "ocradlib.h" "ac_cv_header_ocradlib_h" "$ac_includes_default"
if test "x$ac_cv_header_ocradlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_OCRADLIB_H 1
_ACEOF
ac_lib_ocrad=yes
else
ac_lib_ocrad=no
fi
done
if test "${ac_lib_ocrad}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in ocradlib.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ocrad for ocradlib.h in ${ac_test_location}" >&5
$as_echo_n "checking ocrad for ocradlib.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in ocradlib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "ocradlib.h" "ac_cv_header_ocradlib_h" "$ac_includes_default"
if test "x$ac_cv_header_ocradlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_OCRADLIB_H 1
_ACEOF
ac_lib_ocrad=yes
else
ac_lib_ocrad=no
fi
done
if test "${ac_lib_ocrad}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in ocradlib.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_ocrad}" != "yes"; then :
as_fn_error $? "ocradlib.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
# Check whether --with-poppler-include was given.
if test "${with_poppler_include+set}" = set; then :
withval=$with_poppler_include;
with_poppler="${with_poppler_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_poppler="auto"
fi
if test "${with_poppler}" == "no"; then :
as_fn_error $? "The library poppler is obligatory. You cannot disable it." "$LINENO" 5
fi
# Check whether --with-poppler-lib was given.
if test "${with_poppler_lib+set}" = set; then :
withval=$with_poppler_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in poppler/cpp/poppler-document.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "poppler/cpp/poppler-document.h" "ac_cv_header_poppler_cpp_poppler_document_h" "$ac_includes_default"
if test "x$ac_cv_header_poppler_cpp_poppler_document_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_POPPLER_CPP_POPPLER_DOCUMENT_H 1
_ACEOF
ac_lib_poppler=yes
else
ac_lib_poppler=no
fi
done
if test "${ac_lib_poppler}" != "yes" -a "${with_poppler}" != ""; then :
for ax_var in poppler/cpp/poppler-document.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_poppler}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/poppler-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking poppler for poppler/cpp/poppler-document.h in ${ac_location}" >&5
$as_echo_n "checking poppler for poppler/cpp/poppler-document.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in poppler/cpp/poppler-document.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "poppler/cpp/poppler-document.h" "ac_cv_header_poppler_cpp_poppler_document_h" "$ac_includes_default"
if test "x$ac_cv_header_poppler_cpp_poppler_document_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_POPPLER_CPP_POPPLER_DOCUMENT_H 1
_ACEOF
ac_lib_poppler=yes
else
ac_lib_poppler=no
fi
done
if test "${ac_lib_poppler}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in poppler/cpp/poppler-document.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking poppler for poppler/cpp/poppler-document.h in ${ac_test_location}" >&5
$as_echo_n "checking poppler for poppler/cpp/poppler-document.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in poppler/cpp/poppler-document.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "poppler/cpp/poppler-document.h" "ac_cv_header_poppler_cpp_poppler_document_h" "$ac_includes_default"
if test "x$ac_cv_header_poppler_cpp_poppler_document_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_POPPLER_CPP_POPPLER_DOCUMENT_H 1
_ACEOF
ac_lib_poppler=yes
else
ac_lib_poppler=no
fi
done
if test "${ac_lib_poppler}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in poppler/cpp/poppler-document.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_poppler}" != "yes"; then :
as_fn_error $? "poppler/cpp/poppler-document.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
# Check whether --with-tesseract-include was given.
if test "${with_tesseract_include+set}" = set; then :
withval=$with_tesseract_include; CPPFLAGS="-I${withval} ${CPPFLAGS}"
fi
# Check whether --with-tesseract was given.
if test "${with_tesseract+set}" = set; then :
withval=$with_tesseract;
else
with_tesseract="no"
fi
if test "${with_tesseract}" != "no"; then :
if test "${with_tesseract}" == "" -o "${with_tesseract}" == "yes"; then :
with_tesseract="auto"
fi
# Check whether --with-tesseract-include was given.
if test "${with_tesseract_include+set}" = set; then :
withval=$with_tesseract_include;
with_tesseract="${with_tesseract_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_tesseract="auto"
fi
# Check whether --with-tesseract-lib was given.
if test "${with_tesseract_lib+set}" = set; then :
withval=$with_tesseract_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in tesseract/baseapi.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "tesseract/baseapi.h" "ac_cv_header_tesseract_baseapi_h" "$ac_includes_default"
if test "x$ac_cv_header_tesseract_baseapi_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TESSERACT_BASEAPI_H 1
_ACEOF
ac_lib_tesseract=yes
else
ac_lib_tesseract=no
fi
done
if test "${ac_lib_tesseract}" != "yes" -a "${with_tesseract}" != ""; then :
for ax_var in tesseract/baseapi.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_tesseract}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/tesseract-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking tesseract for tesseract/baseapi.h in ${ac_location}" >&5
$as_echo_n "checking tesseract for tesseract/baseapi.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in tesseract/baseapi.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "tesseract/baseapi.h" "ac_cv_header_tesseract_baseapi_h" "$ac_includes_default"
if test "x$ac_cv_header_tesseract_baseapi_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TESSERACT_BASEAPI_H 1
_ACEOF
ac_lib_tesseract=yes
else
ac_lib_tesseract=no
fi
done
if test "${ac_lib_tesseract}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in tesseract/baseapi.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking tesseract for tesseract/baseapi.h in ${ac_test_location}" >&5
$as_echo_n "checking tesseract for tesseract/baseapi.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in tesseract/baseapi.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "tesseract/baseapi.h" "ac_cv_header_tesseract_baseapi_h" "$ac_includes_default"
if test "x$ac_cv_header_tesseract_baseapi_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TESSERACT_BASEAPI_H 1
_ACEOF
ac_lib_tesseract=yes
else
ac_lib_tesseract=no
fi
done
if test "${ac_lib_tesseract}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in tesseract/baseapi.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
fi
# Check whether --with-cuneiform was given.
if test "${with_cuneiform+set}" = set; then :
withval=$with_cuneiform;
else
with_cuneiform="no"
fi
if test "${with_cuneiform}" != "no"; then :
if test "${with_cuneiform}" == "" -o "${with_cuneiform}" == "yes"; then :
with_cuneiform="auto"
fi
# Check whether --with-cuneiform-include was given.
if test "${with_cuneiform_include+set}" = set; then :
withval=$with_cuneiform_include;
with_cuneiform="${with_cuneiform_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_cuneiform="auto"
fi
# Check whether --with-cuneiform-lib was given.
if test "${with_cuneiform_lib+set}" = set; then :
withval=$with_cuneiform_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in cuneiform.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "cuneiform.h" "ac_cv_header_cuneiform_h" "$ac_includes_default"
if test "x$ac_cv_header_cuneiform_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_CUNEIFORM_H 1
_ACEOF
ac_lib_cuneiform=yes
else
ac_lib_cuneiform=no
fi
done
if test "${ac_lib_cuneiform}" != "yes" -a "${with_cuneiform}" != ""; then :
for ax_var in cuneiform.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_cuneiform}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/cuneiform-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking cuneiform for cuneiform.h in ${ac_location}" >&5
$as_echo_n "checking cuneiform for cuneiform.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in cuneiform.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "cuneiform.h" "ac_cv_header_cuneiform_h" "$ac_includes_default"
if test "x$ac_cv_header_cuneiform_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_CUNEIFORM_H 1
_ACEOF
ac_lib_cuneiform=yes
else
ac_lib_cuneiform=no
fi
done
if test "${ac_lib_cuneiform}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in cuneiform.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking cuneiform for cuneiform.h in ${ac_test_location}" >&5
$as_echo_n "checking cuneiform for cuneiform.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in cuneiform.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "cuneiform.h" "ac_cv_header_cuneiform_h" "$ac_includes_default"
if test "x$ac_cv_header_cuneiform_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_CUNEIFORM_H 1
_ACEOF
ac_lib_cuneiform=yes
else
ac_lib_cuneiform=no
fi
done
if test "${ac_lib_cuneiform}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in cuneiform.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
fi
# Check whether --with-openbabel-include was given.
if test "${with_openbabel_include+set}" = set; then :
withval=$with_openbabel_include;
with_openbabel="${with_openbabel_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_openbabel="/usr/include/openbabel3 /usr/local/include/openbabel3"
fi
if test "${with_openbabel}" == "no"; then :
as_fn_error $? "The library openbabel is obligatory. You cannot disable it." "$LINENO" 5
fi
# Check whether --with-openbabel-lib was given.
if test "${with_openbabel_lib+set}" = set; then :
withval=$with_openbabel_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
ac_lib_openbabel=yes
else
ac_lib_openbabel=no
fi
done
if test "${ac_lib_openbabel}" != "yes" -a "${with_openbabel}" != ""; then :
for ax_var in openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_openbabel}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/openbabel-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking openbabel for openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h in ${ac_location}" >&5
$as_echo_n "checking openbabel for openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
ac_lib_openbabel=yes
else
ac_lib_openbabel=no
fi
done
if test "${ac_lib_openbabel}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking openbabel for openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h in ${ac_test_location}" >&5
$as_echo_n "checking openbabel for openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
ac_lib_openbabel=yes
else
ac_lib_openbabel=no
fi
done
if test "${ac_lib_openbabel}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_openbabel}" != "yes"; then :
as_fn_error $? "openbabel/mol.h openbabel/obconversion.h openbabel/builder.h openbabel/alias.h openbabel/stereo/tetrahedral.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
osra_header_limits=yes
ac_fn_cxx_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default"
if test "x$ac_cv_header_limits_h" = xyes; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
int a = INT_MAX;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
osra_header_limits=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
osra_header_limits=no
fi
if test "${osra_header_limits}" != "yes"; then :
as_fn_error $? "limits.h was not found; make sure you have installed libc-dev package or check config.log" "$LINENO" 5
fi
osra_header_float=yes
ac_fn_cxx_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default"
if test "x$ac_cv_header_float_h" = xyes; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
float f = FLT_MAX;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
osra_header_float=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
osra_header_float=no
fi
if test "${osra_header_float}" != "yes"; then :
as_fn_error $? "float.h was not found; make sure you have installed libc-dev package or check config.log" "$LINENO" 5
fi
osra_header_libgen=yes
ac_fn_cxx_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default"
if test "x$ac_cv_header_libgen_h" = xyes; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
char *a = dirname("");
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
osra_header_libgen=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
osra_header_libgen=no
fi
if test "${osra_header_libgen}" != "yes"; then :
as_fn_error $? "libgen.h was not found; make sure you have installed libc-dev package or check config.log" "$LINENO" 5
fi
osra_lib_math=yes
ac_fn_cxx_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default"
if test "x$ac_cv_header_math_h" = xyes; then :
if test "$build_os" != "darwin"; then :
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lm" >&5
$as_echo_n "checking for -lm... " >&6; }
if ${ac_cv_lib_m+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in m
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
sqrt(1); fabs(1);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_m=yes
else
ac_cv_lib_m=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_m" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
sqrt(1); fabs(1);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_m=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m" >&5
$as_echo "$ac_cv_lib_m" >&6; }
if test "x$ac_cv_lib_m" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in m
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_math=no
fi
fi
else
osra_lib_math=no
fi
if test "${osra_lib_math}" != "yes"; then :
as_fn_error $? "math.h or libm was not found; make sure you have installed libc-dev package or check config.log" "$LINENO" 5
fi
osra_lib_tclap=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include // Defines the EOF constant; needed for MinGW
#include
#include
int
main ()
{
TCLAP::CmdLine cmd("");
TCLAP::ValueArg a1("", "", "", false, 0, "");
cmd.add(a1);
TCLAP::SwitchArg a2("", "", "", false);
cmd.add(a2);
cmd.parse(0, NULL);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
osra_lib_tclap=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "${osra_lib_tclap}" != "yes"; then :
as_fn_error $? "TCLAP API check failed; make sure you have installed libtclap-dev package or check config.log" "$LINENO" 5
fi
osra_lib_potrace=yes
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lpotrace" >&5
$as_echo_n "checking for -lpotrace... " >&6; }
if ${ac_cv_lib_potrace+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in potrace
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern "C" {
#include
}
int
main ()
{
potrace_state_t state;
potrace_param_t param;
potrace_bitmap_t bitmap;
potrace_path_t path;
potrace_dpoint_t dpoint;
potrace_trace(¶m, &bitmap);
potrace_state_free(&state);
potrace_param_default();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_potrace=yes
else
ac_cv_lib_potrace=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_potrace" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern "C" {
#include
}
int
main ()
{
potrace_state_t state;
potrace_param_t param;
potrace_bitmap_t bitmap;
potrace_path_t path;
potrace_dpoint_t dpoint;
potrace_trace(¶m, &bitmap);
potrace_state_free(&state);
potrace_param_default();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_potrace=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_potrace" >&5
$as_echo "$ac_cv_lib_potrace" >&6; }
if test "x$ac_cv_lib_potrace" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPOTRACE 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in potrace
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_potrace=no
fi
if test "${osra_lib_potrace}" != "yes"; then :
as_fn_error $? "POTRACE API check failed; make sure you have installed libpotrace-dev package or check config.log" "$LINENO" 5
fi
osra_lib_ocrad=yes
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -locrad" >&5
$as_echo_n "checking for -locrad... " >&6; }
if ${ac_cv_lib_ocrad+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in ocrad
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
struct OCRAD_Pixmap opix;
OCRAD_Descriptor * const ocrdes = OCRAD_open();
OCRAD_get_errno(ocrdes);
OCRAD_set_image(ocrdes, &opix, 0);
OCRAD_scale(ocrdes, 2);
OCRAD_recognize(ocrdes, 0);
OCRAD_result_first_character(ocrdes);
OCRAD_close(ocrdes);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_ocrad=yes
else
ac_cv_lib_ocrad=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_ocrad" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
struct OCRAD_Pixmap opix;
OCRAD_Descriptor * const ocrdes = OCRAD_open();
OCRAD_get_errno(ocrdes);
OCRAD_set_image(ocrdes, &opix, 0);
OCRAD_scale(ocrdes, 2);
OCRAD_recognize(ocrdes, 0);
OCRAD_result_first_character(ocrdes);
OCRAD_close(ocrdes);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_ocrad=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ocrad" >&5
$as_echo "$ac_cv_lib_ocrad" >&6; }
if test "x$ac_cv_lib_ocrad" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBOCRAD 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in ocrad
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_ocrad=no
fi
if test "${osra_lib_ocrad}" != "yes"; then :
as_fn_error $? "OCRAD API check failed; make sure you have installed libocrad-dev package or check config.log" "$LINENO" 5
fi
osra_lib_poppler=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_init in -lpthread" >&5
$as_echo_n "checking for sem_init in -lpthread... " >&6; }
if ${ac_cv_lib_pthread_sem_init+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $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 sem_init ();
int
main ()
{
return sem_init ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_pthread_sem_init=yes
else
ac_cv_lib_pthread_sem_init=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_pthread_sem_init" >&5
$as_echo "$ac_cv_lib_pthread_sem_init" >&6; }
if test "x$ac_cv_lib_pthread_sem_init" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPTHREAD 1
_ACEOF
LIBS="-lpthread $LIBS"
else
ac_lib_poppler=no
fi
if test "${enable_static_linking:+set}" == "set" -o "$build_os" == "darwin"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5
$as_echo_n "checking for inflateEnd in -lz... " >&6; }
if ${ac_cv_lib_z_inflateEnd+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $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 inflateEnd ();
int
main ()
{
return inflateEnd ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_z_inflateEnd=yes
else
ac_cv_lib_z_inflateEnd=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_z_inflateEnd" >&5
$as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
if test "x$ac_cv_lib_z_inflateEnd" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBZ 1
_ACEOF
LIBS="-lz $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzlibVersion in -lbz2" >&5
$as_echo_n "checking for BZ2_bzlibVersion in -lbz2... " >&6; }
if ${ac_cv_lib_bz2_BZ2_bzlibVersion+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbz2 $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 BZ2_bzlibVersion ();
int
main ()
{
return BZ2_bzlibVersion ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_bz2_BZ2_bzlibVersion=yes
else
ac_cv_lib_bz2_BZ2_bzlibVersion=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_bz2_BZ2_bzlibVersion" >&5
$as_echo "$ac_cv_lib_bz2_BZ2_bzlibVersion" >&6; }
if test "x$ac_cv_lib_bz2_BZ2_bzlibVersion" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBBZ2 1
_ACEOF
LIBS="-lbz2 $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in -lpng" >&5
$as_echo_n "checking for png_create_read_struct in -lpng... " >&6; }
if ${ac_cv_lib_png_png_create_read_struct+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng $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 png_create_read_struct ();
int
main ()
{
return png_create_read_struct ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_png_png_create_read_struct=yes
else
ac_cv_lib_png_png_create_read_struct=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_png_png_create_read_struct" >&5
$as_echo "$ac_cv_lib_png_png_create_read_struct" >&6; }
if test "x$ac_cv_lib_png_png_create_read_struct" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPNG 1
_ACEOF
LIBS="-lpng $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
$as_echo_n "checking for libiconv_open in -liconv... " >&6; }
if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv $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 libiconv_open ();
int
main ()
{
return libiconv_open ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_iconv_libiconv_open=yes
else
ac_cv_lib_iconv_libiconv_open=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_iconv_libiconv_open" >&5
$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBICONV 1
_ACEOF
LIBS="-liconv $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate in -lexpat" >&5
$as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; }
if ${ac_cv_lib_expat_XML_ParserCreate+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lexpat $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 XML_ParserCreate ();
int
main ()
{
return XML_ParserCreate ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_expat_XML_ParserCreate=yes
else
ac_cv_lib_expat_XML_ParserCreate=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_expat_XML_ParserCreate" >&5
$as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; }
if test "x$ac_cv_lib_expat_XML_ParserCreate" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBEXPAT 1
_ACEOF
LIBS="-lexpat $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cmsSetLogErrorHandler in -llcms2" >&5
$as_echo_n "checking for cmsSetLogErrorHandler in -llcms2... " >&6; }
if ${ac_cv_lib_lcms2_cmsSetLogErrorHandler+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-llcms2 $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 cmsSetLogErrorHandler ();
int
main ()
{
return cmsSetLogErrorHandler ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_lcms2_cmsSetLogErrorHandler=yes
else
ac_cv_lib_lcms2_cmsSetLogErrorHandler=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_lcms2_cmsSetLogErrorHandler" >&5
$as_echo "$ac_cv_lib_lcms2_cmsSetLogErrorHandler" >&6; }
if test "x$ac_cv_lib_lcms2_cmsSetLogErrorHandler" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBLCMS2 1
_ACEOF
LIBS="-llcms2 $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFFdOpen in -ltiff" >&5
$as_echo_n "checking for TIFFFdOpen in -ltiff... " >&6; }
if ${ac_cv_lib_tiff_TIFFFdOpen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltiff $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 TIFFFdOpen ();
int
main ()
{
return TIFFFdOpen ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_tiff_TIFFFdOpen=yes
else
ac_cv_lib_tiff_TIFFFdOpen=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_tiff_TIFFFdOpen" >&5
$as_echo "$ac_cv_lib_tiff_TIFFFdOpen" >&6; }
if test "x$ac_cv_lib_tiff_TIFFFdOpen" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBTIFF 1
_ACEOF
LIBS="-ltiff $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_compress in -ljpeg" >&5
$as_echo_n "checking for jpeg_destroy_compress in -ljpeg... " >&6; }
if ${ac_cv_lib_jpeg_jpeg_destroy_compress+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg $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 jpeg_destroy_compress ();
int
main ()
{
return jpeg_destroy_compress ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_jpeg_jpeg_destroy_compress=yes
else
ac_cv_lib_jpeg_jpeg_destroy_compress=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_jpeg_jpeg_destroy_compress" >&5
$as_echo "$ac_cv_lib_jpeg_jpeg_destroy_compress" >&6; }
if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF
LIBS="-ljpeg $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_image_destroy in -lopenjp2" >&5
$as_echo_n "checking for opj_image_destroy in -lopenjp2... " >&6; }
if ${ac_cv_lib_openjp2_opj_image_destroy+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lopenjp2 $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 opj_image_destroy ();
int
main ()
{
return opj_image_destroy ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_openjp2_opj_image_destroy=yes
else
ac_cv_lib_openjp2_opj_image_destroy=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_openjp2_opj_image_destroy" >&5
$as_echo "$ac_cv_lib_openjp2_opj_image_destroy" >&6; }
if test "x$ac_cv_lib_openjp2_opj_image_destroy" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBOPENJP2 1
_ACEOF
LIBS="-lopenjp2 $LIBS"
else
ac_lib_poppler=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5
$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; }
if ${ac_cv_lib_freetype_FT_Init_FreeType+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfreetype $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 FT_Init_FreeType ();
int
main ()
{
return FT_Init_FreeType ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_freetype_FT_Init_FreeType=yes
else
ac_cv_lib_freetype_FT_Init_FreeType=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_freetype_FT_Init_FreeType" >&5
$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBFREETYPE 1
_ACEOF
LIBS="-lfreetype $LIBS"
else
ac_lib_poppler=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcInit in -lfontconfig" >&5
$as_echo_n "checking for FcInit in -lfontconfig... " >&6; }
if ${ac_cv_lib_fontconfig_FcInit+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfontconfig $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 FcInit ();
int
main ()
{
return FcInit ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_fontconfig_FcInit=yes
else
ac_cv_lib_fontconfig_FcInit=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_fontconfig_FcInit" >&5
$as_echo "$ac_cv_lib_fontconfig_FcInit" >&6; }
if test "x$ac_cv_lib_fontconfig_FcInit" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBFONTCONFIG 1
_ACEOF
LIBS="-lfontconfig $LIBS"
else
ac_lib_poppler=no
fi
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libs: poppler poppler-cpp" >&5
$as_echo_n "checking for libs: poppler poppler-cpp... " >&6; }
if ${ac_cv_lib_poppler_poppler_cpp+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in poppler poppler-cpp
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
int
main ()
{
std::string input;
poppler::document* doc = poppler::document::load_from_file(input);
poppler::page_renderer r;
int num_pages = doc->pages();
for (int i = 0; i < num_pages; i++)
{
poppler::page* p = doc->create_page(i);
poppler::image im = r.render_page(p);
const char *d = im.const_data();
}
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_poppler_poppler_cpp=yes
else
ac_cv_lib_poppler_poppler_cpp=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_poppler_poppler_cpp" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
int
main ()
{
std::string input;
poppler::document* doc = poppler::document::load_from_file(input);
poppler::page_renderer r;
int num_pages = doc->pages();
for (int i = 0; i < num_pages; i++)
{
poppler::page* p = doc->create_page(i);
poppler::image im = r.render_page(p);
const char *d = im.const_data();
}
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_poppler_poppler_cpp=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_poppler_poppler_cpp" >&5
$as_echo "$ac_cv_lib_poppler_poppler_cpp" >&6; }
if test "x$ac_cv_lib_poppler_poppler_cpp" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPOPPLER_POPPLER_CPP 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in poppler poppler-cpp
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_poppler=no
fi
if test "${osra_lib_poppler}" != "yes"; then :
as_fn_error $? "POPPLER API check failed; make sure you have installed poppler-devel package or check config.log" "$LINENO" 5
fi
if test "${ac_lib_tesseract}" == "yes"; then :
if test "${enable_static_linking:+set}" == "set"; then :
LIBS="-ljpeg -lz ${LIBS}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_init in -lpthread" >&5
$as_echo_n "checking for sem_init in -lpthread... " >&6; }
if ${ac_cv_lib_pthread_sem_init+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $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 sem_init ();
int
main ()
{
return sem_init ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_pthread_sem_init=yes
else
ac_cv_lib_pthread_sem_init=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_pthread_sem_init" >&5
$as_echo "$ac_cv_lib_pthread_sem_init" >&6; }
if test "x$ac_cv_lib_pthread_sem_init" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPTHREAD 1
_ACEOF
LIBS="-lpthread $LIBS"
else
ac_lib_tesseract=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFGetField in -ltiff" >&5
$as_echo_n "checking for TIFFGetField in -ltiff... " >&6; }
if ${ac_cv_lib_tiff_TIFFGetField+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltiff $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 TIFFGetField ();
int
main ()
{
return TIFFGetField ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_tiff_TIFFGetField=yes
else
ac_cv_lib_tiff_TIFFGetField=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_tiff_TIFFGetField" >&5
$as_echo "$ac_cv_lib_tiff_TIFFGetField" >&6; }
if test "x$ac_cv_lib_tiff_TIFFGetField" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBTIFF 1
_ACEOF
LIBS="-ltiff $LIBS"
else
ac_lib_tesseract=no
fi
fi
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ltesseract" >&5
$as_echo_n "checking for -ltesseract... " >&6; }
if ${ac_cv_lib_tesseract+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in tesseract
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
using namespace tesseract;
int
main ()
{
TessBaseAPI tess;
tess.Init(NULL, "");
char* text = tess.TesseractRect((const unsigned char*) NULL, 1, 0, 0, 0, 0, 0);
tess.End();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_tesseract=yes
else
ac_cv_lib_tesseract=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_tesseract" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
using namespace tesseract;
int
main ()
{
TessBaseAPI tess;
tess.Init(NULL, "");
char* text = tess.TesseractRect((const unsigned char*) NULL, 1, 0, 0, 0, 0, 0);
tess.End();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_tesseract=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tesseract" >&5
$as_echo "$ac_cv_lib_tesseract" >&6; }
if test "x$ac_cv_lib_tesseract" = xyes; then :
$as_echo "#define HAVE_TESSERACT_LIB 1" >>confdefs.h
TESSERACT_LIB=yes
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBTESSERACT 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in tesseract
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
ac_lib_tesseract=no
fi
fi
if test "${with_tesseract}" != "no" -a "${ac_lib_tesseract}" == "no"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Tesseract library support was requested, but disabled due to API check failure (see above messages for the reason or check config.log)" >&5
$as_echo "$as_me: WARNING: Tesseract library support was requested, but disabled due to API check failure (see above messages for the reason or check config.log)" >&2;}
fi
if test "${ac_lib_cuneiform}" == "yes"; then :
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lcuneiform" >&5
$as_echo_n "checking for -lcuneiform... " >&6; }
if ${ac_cv_lib_cuneiform+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in cuneiform
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
PUMA_XOpen(NULL, "");
PUMA_XFinalRecognition();
PUMA_XClose();
PUMA_Init(0, NULL);
PUMA_SetImportData(PUMA_Word32_Language, NULL);
PUMA_SaveToMemory(NULL, PUMA_TOTEXT, PUMA_CODE_ASCII, NULL, 1);
PUMA_Done();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_cuneiform=yes
else
ac_cv_lib_cuneiform=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_cuneiform" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
PUMA_XOpen(NULL, "");
PUMA_XFinalRecognition();
PUMA_XClose();
PUMA_Init(0, NULL);
PUMA_SetImportData(PUMA_Word32_Language, NULL);
PUMA_SaveToMemory(NULL, PUMA_TOTEXT, PUMA_CODE_ASCII, NULL, 1);
PUMA_Done();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_cuneiform=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cuneiform" >&5
$as_echo "$ac_cv_lib_cuneiform" >&6; }
if test "x$ac_cv_lib_cuneiform" = xyes; then :
$as_echo "#define HAVE_CUNEIFORM_LIB 1" >>confdefs.h
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBCUNEIFORM 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in cuneiform
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
ac_lib_cuneiform=no
fi
fi
if test "${with_cuneiform}" != "no" -a "${ac_lib_cuneiform}" == "no"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cineiform library support was requested, but disabled due to API check failure (see above messages for the reason or check config.log)" >&5
$as_echo "$as_me: WARNING: Cineiform library support was requested, but disabled due to API check failure (see above messages for the reason or check config.log)" >&2;}
fi
osra_lib_openbabel=yes
if test "$build_os" == "mingw"; then :
LIBS="-lws2_32 ${LIBS}"
fi
if test "${enable_static_linking:+set}" == "set" -o "$build_os" == "darwin"; then :
if test "$build_os" == "darwin"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetINCHI in -linchi" >&5
$as_echo_n "checking for GetINCHI in -linchi... " >&6; }
if ${ac_cv_lib_inchi_GetINCHI+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-linchi $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 GetINCHI ();
int
main ()
{
return GetINCHI ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_inchi_GetINCHI=yes
else
ac_cv_lib_inchi_GetINCHI=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_inchi_GetINCHI" >&5
$as_echo "$ac_cv_lib_inchi_GetINCHI" >&6; }
if test "x$ac_cv_lib_inchi_GetINCHI" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBINCHI 1
_ACEOF
LIBS="-linchi $LIBS"
fi
LIBS="${MACPORTSLIBS}/libxml2.a ${MACPORTSLIBS}/libiconv.a ${MACPORTSLIBS}/libz.a ${LIBS}"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetINCHI in -linchi" >&5
$as_echo_n "checking for GetINCHI in -linchi... " >&6; }
if ${ac_cv_lib_inchi_GetINCHI+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-linchi $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 GetINCHI ();
int
main ()
{
return GetINCHI ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_inchi_GetINCHI=yes
else
ac_cv_lib_inchi_GetINCHI=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_inchi_GetINCHI" >&5
$as_echo "$ac_cv_lib_inchi_GetINCHI" >&6; }
if test "x$ac_cv_lib_inchi_GetINCHI" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBINCHI 1
_ACEOF
LIBS="-linchi $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5
$as_echo_n "checking for inflateEnd in -lz... " >&6; }
if ${ac_cv_lib_z_inflateEnd+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $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 inflateEnd ();
int
main ()
{
return inflateEnd ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_z_inflateEnd=yes
else
ac_cv_lib_z_inflateEnd=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_z_inflateEnd" >&5
$as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
if test "x$ac_cv_lib_z_inflateEnd" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBZ 1
_ACEOF
LIBS="-lz $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlParseFile in -lxml2" >&5
$as_echo_n "checking for xmlParseFile in -lxml2... " >&6; }
if ${ac_cv_lib_xml2_xmlParseFile+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxml2 $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 xmlParseFile ();
int
main ()
{
return xmlParseFile ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_xml2_xmlParseFile=yes
else
ac_cv_lib_xml2_xmlParseFile=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_xml2_xmlParseFile" >&5
$as_echo "$ac_cv_lib_xml2_xmlParseFile" >&6; }
if test "x$ac_cv_lib_xml2_xmlParseFile" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXML2 1
_ACEOF
LIBS="-lxml2 $LIBS"
fi
fi
fi
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lopenbabel" >&5
$as_echo_n "checking for -lopenbabel... " >&6; }
if ${ac_cv_lib_openbabel+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in openbabel
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
#include
#include
#include
#include
#include
int
main ()
{
OpenBabel::OBPairData label;
OpenBabel::AliasData aliasData;
OpenBabel::OBAtomIterator atom_iter;
OpenBabel::OBAtom atom;
OpenBabel::OBBond bond;
OpenBabel::OBRing ring;
OpenBabel::OBMol mol;
OpenBabel::OBStereoFacade facade(&mol);
OpenBabel::OBTetrahedralStereo stereo(&mol);
OpenBabel::OBConversion conversion;
label.SetAttribute("");
label.SetValue("");
aliasData.Expand(mol, 1);
aliasData.SetAlias("");
aliasData.SetOrigin(OpenBabel::external);
atom.Clear();
atom.GetAtomicNum();
atom.GetFormalCharge();
atom.GetId();
atom.GetParent();
atom.GetAtomicNum();
atom.IsChiral();
atom.IsHeteroatom();
atom.SetAtomicNum(0);
atom.SetData(&aliasData);
atom.SetFormalCharge(0);
atom.SetIdx(0);
atom.SetVector(0, 0, 0);
bond.GetBeginAtom();
bond.GetBondOrder();
bond.GetFlags();
bond.GetBondOrder();
bond.IsHash();
bond.IsInRing();
// bond.IsTriple();
bond.IsWedge();
bond.SetBondOrder(0);
// bond.UnsetAromatic();
// bond.UnsetDown();
// bond.UnsetHash();
// bond.UnsetUp();
// bond.UnsetWedge();
ring.IsAromatic();
mol.AddBond(0, 0, 0, 0);
mol.AssignSpinMultiplicity(false);
mol.BeginAtom(atom_iter);
mol.BeginModify();
mol.ConnectTheDots();
std::vector< std::vector > v;
mol.ContigFragList(v);
mol.EndModify();
mol.FindRingAtomsAndBonds();
mol.GetAtom(0);
mol.GetBond(0);
mol.GetFirstAtom();
mol.GetSSSR();
mol.NewAtom();
mol.NextAtom(atom_iter);
mol.NumAtoms();
mol.NumBonds();
mol.NumRotors();
mol.Separate();
mol.SetData(&label);
mol.SetDimension(0);
mol.StripSalts(0);
facade.HasTetrahedralStereo(0);
facade.GetTetrahedralStereo(0);
stereo.GetConfig();
conversion.SetInFormat("");
conversion.SetOutFormat("");
conversion.ReadString(&mol, "");
conversion.Read(&mol);
conversion.WriteString(&mol, false);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_openbabel=yes
else
ac_cv_lib_openbabel=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_openbabel" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
#include
#include
#include
#include
#include
int
main ()
{
OpenBabel::OBPairData label;
OpenBabel::AliasData aliasData;
OpenBabel::OBAtomIterator atom_iter;
OpenBabel::OBAtom atom;
OpenBabel::OBBond bond;
OpenBabel::OBRing ring;
OpenBabel::OBMol mol;
OpenBabel::OBStereoFacade facade(&mol);
OpenBabel::OBTetrahedralStereo stereo(&mol);
OpenBabel::OBConversion conversion;
label.SetAttribute("");
label.SetValue("");
aliasData.Expand(mol, 1);
aliasData.SetAlias("");
aliasData.SetOrigin(OpenBabel::external);
atom.Clear();
atom.GetAtomicNum();
atom.GetFormalCharge();
atom.GetId();
atom.GetParent();
atom.GetAtomicNum();
atom.IsChiral();
atom.IsHeteroatom();
atom.SetAtomicNum(0);
atom.SetData(&aliasData);
atom.SetFormalCharge(0);
atom.SetIdx(0);
atom.SetVector(0, 0, 0);
bond.GetBeginAtom();
bond.GetBondOrder();
bond.GetFlags();
bond.GetBondOrder();
bond.IsHash();
bond.IsInRing();
// bond.IsTriple();
bond.IsWedge();
bond.SetBondOrder(0);
// bond.UnsetAromatic();
// bond.UnsetDown();
// bond.UnsetHash();
// bond.UnsetUp();
// bond.UnsetWedge();
ring.IsAromatic();
mol.AddBond(0, 0, 0, 0);
mol.AssignSpinMultiplicity(false);
mol.BeginAtom(atom_iter);
mol.BeginModify();
mol.ConnectTheDots();
std::vector< std::vector > v;
mol.ContigFragList(v);
mol.EndModify();
mol.FindRingAtomsAndBonds();
mol.GetAtom(0);
mol.GetBond(0);
mol.GetFirstAtom();
mol.GetSSSR();
mol.NewAtom();
mol.NextAtom(atom_iter);
mol.NumAtoms();
mol.NumBonds();
mol.NumRotors();
mol.Separate();
mol.SetData(&label);
mol.SetDimension(0);
mol.StripSalts(0);
facade.HasTetrahedralStereo(0);
facade.GetTetrahedralStereo(0);
stereo.GetConfig();
conversion.SetInFormat("");
conversion.SetOutFormat("");
conversion.ReadString(&mol, "");
conversion.Read(&mol);
conversion.WriteString(&mol, false);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_openbabel=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openbabel" >&5
$as_echo "$ac_cv_lib_openbabel" >&6; }
if test "x$ac_cv_lib_openbabel" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBOPENBABEL 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in openbabel
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_openbabel=no
fi
if test "${osra_lib_openbabel}" != "yes"; then :
as_fn_error $? "OpenBabel API check failed; make sure you have installed libopenbabel-dev package or check config.log" "$LINENO" 5
fi
# Check whether --enable-graphicsmagick-config was given.
if test "${enable_graphicsmagick_config+set}" = set; then :
enableval=$enable_graphicsmagick_config;
fi
if test "${enable_graphicsmagick_config:+set}" != "set"; then :
# Extract the first word of "GraphicsMagick++-config", so it can be a program name with args.
set dummy GraphicsMagick++-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_GRAPHICS_MAGICK_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GRAPHICS_MAGICK_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_GRAPHICS_MAGICK_CONFIG="$GRAPHICS_MAGICK_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_GRAPHICS_MAGICK_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
GRAPHICS_MAGICK_CONFIG=$ac_cv_path_GRAPHICS_MAGICK_CONFIG
if test -n "$GRAPHICS_MAGICK_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GRAPHICS_MAGICK_CONFIG" >&5
$as_echo "$GRAPHICS_MAGICK_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "${GRAPHICS_MAGICK_CONFIG}" == ""; then :
as_fn_error $? "GraphicsMagick++-config was not found; make sure you have installed libgraphicsmagick++-dev package" "$LINENO" 5
fi
CPPFLAGS="`${GRAPHICS_MAGICK_CONFIG} --cppflags` ${CPPFLAGS}"
if test "${enable_static_linking:+set}" == "set" -o "$build_os" == "darwin"; then :
LIBS="`${GRAPHICS_MAGICK_CONFIG} --libs` ${LIBS}"
if test "$build_os" == "cygwin"; then :
LIBS="-lxcb -lXau -lXdmcp ${LIBS}"
fi
fi
else
if test "${enable_static_linking:+set}" == "set" -o "$build_os" == "darwin"; then :
LIBS="-ljpeg ${MACPORTSLIBS}/liblcms2.a ${MACPORTSLIBS}/libtiff.a ${MACPORTSLIBS}/libfreetype.a ${MACPORTSLIBS}/libjasper.a ${MACPORTSLIBS}/libpng.a ${MACPORTSLIBS}/libbz2.a ${MACPORTSLIBS}/libz.a ${LIBS}"
fi
fi
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" LIBS=\"${LIBS}\" after populated with GraphicsMagick++-config" >&5
# Check whether --with-graphicsmagick-include was given.
if test "${with_graphicsmagick_include+set}" = set; then :
withval=$with_graphicsmagick_include;
with_graphicsmagick="${with_graphicsmagick_include}"
CPPFLAGS="-I${withval} ${CPPFLAGS}"
else
with_graphicsmagick="/usr/include/GraphicsMagick /usr/local/include/GraphicsMagick"
fi
if test "${with_graphicsmagick}" == "no"; then :
as_fn_error $? "The library graphicsmagick is obligatory. You cannot disable it." "$LINENO" 5
fi
# Check whether --with-graphicsmagick-lib was given.
if test "${with_graphicsmagick_lib+set}" = set; then :
withval=$with_graphicsmagick_lib; LDFLAGS="-L${withval} ${LDFLAGS}"
fi
for ac_header in Magick++.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "Magick++.h" "ac_cv_header_Magickpp_h" "$ac_includes_default"
if test "x$ac_cv_header_Magickpp_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MAGICK___H 1
_ACEOF
ac_lib_graphicsmagick=yes
else
ac_lib_graphicsmagick=no
fi
done
if test "${ac_lib_graphicsmagick}" != "yes" -a "${with_graphicsmagick}" != ""; then :
for ax_var in Magick++.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
for ac_test_location in ${with_graphicsmagick}
do :
if test "${ac_test_location}" = "auto"; then :
for ac_location in `ls -1d $HOME/graphicsmagick-* 2>/dev/null | tac`
do :
if test -d "${ac_location}"; then :
ax_probe_library_save_LDFLAGS=${LDFLAGS}
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
for ac_inc_location in `find "${ac_location}" -iname '*.h' |
while read ac_include_location; do dirname "${ac_include_location}"; done |
sort -u`
do :
CPPFLAGS="-I${ac_inc_location} ${CPPFLAGS}"
done
for ac_lib_location in `find "${ac_location}" -iname '*.so' -o -iname '*.sl' -o -iname '*.dylib' -o -iname '*.a' -o -iname '*.dll' |
while read ac_library_location; do dirname "${ac_library_location}"; done |
sort -u`
do :
LDFLAGS="-L${ac_lib_location} ${LDFLAGS}"
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking graphicsmagick for Magick++.h in ${ac_location}" >&5
$as_echo_n "checking graphicsmagick for Magick++.h in ${ac_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" and LDFLAGS=\"${LDFLAGS}\" for HOME location check" >&5
for ac_header in Magick++.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "Magick++.h" "ac_cv_header_Magickpp_h" "$ac_includes_default"
if test "x$ac_cv_header_Magickpp_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MAGICK___H 1
_ACEOF
ac_lib_graphicsmagick=yes
else
ac_lib_graphicsmagick=no
fi
done
if test "${ac_lib_graphicsmagick}" = "yes"; then :
break 2
fi
LDFLAGS=${ax_probe_library_save_LDFLAGS}
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in Magick++.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
else
ax_probe_library_save_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="-I${ac_test_location} $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking graphicsmagick for Magick++.h in ${ac_test_location}" >&5
$as_echo_n "checking graphicsmagick for Magick++.h in ${ac_test_location}... " >&6; }
$as_echo
$as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS=\"${CPPFLAGS}\" for custom location check" >&5
for ac_header in Magick++.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "Magick++.h" "ac_cv_header_Magickpp_h" "$ac_includes_default"
if test "x$ac_cv_header_Magickpp_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MAGICK___H 1
_ACEOF
ac_lib_graphicsmagick=yes
else
ac_lib_graphicsmagick=no
fi
done
if test "${ac_lib_graphicsmagick}" = "yes"; then :
break
fi
CPPFLAGS=${ax_probe_library_save_CPPFLAGS}
for ax_var in Magick++.h
do :
as_ax_Var=`$as_echo "ac_cv_header_${ax_var}" | $as_tr_sh`
{ eval $as_ax_Var=; unset $as_ax_Var;}
done
fi
done
fi
if test "${ac_lib_graphicsmagick}" != "yes"; then :
as_fn_error $? "Magick++.h header(s) is missing. Check the default/listed above headers locations." "$LINENO" 5
fi
osra_lib_graphicsmagick=yes
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libs: GraphicsMagick++ GraphicsMagick" >&5
$as_echo_n "checking for libs: GraphicsMagick++ GraphicsMagick... " >&6; }
if ${ac_cv_lib_GraphicsMagickpp_GraphicsMagick+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in GraphicsMagick++ GraphicsMagick
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
Magick::Image image;
Magick::Color color;
Magick::ColorRGB colorRGB;
Magick::ColorGray colorGray;
image.getPixels(0, 0, 0, 0);
image.pixelColor(0, 0);
image.columns();
image.rows();
image.matte();
image.backgroundColor(color);
image.rotate(0);
color.alpha();
colorRGB.red();
colorRGB.green();
colorRGB.blue();
colorGray.shade();
MagickLib::InitializeMagick((char*) 0);
MagickLib::DestroyMagick();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_GraphicsMagickpp_GraphicsMagick=yes
else
ac_cv_lib_GraphicsMagickpp_GraphicsMagick=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_GraphicsMagickpp_GraphicsMagick" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
Magick::Image image;
Magick::Color color;
Magick::ColorRGB colorRGB;
Magick::ColorGray colorGray;
image.getPixels(0, 0, 0, 0);
image.pixelColor(0, 0);
image.columns();
image.rows();
image.matte();
image.backgroundColor(color);
image.rotate(0);
color.alpha();
colorRGB.red();
colorRGB.green();
colorRGB.blue();
colorGray.shade();
MagickLib::InitializeMagick((char*) 0);
MagickLib::DestroyMagick();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_GraphicsMagickpp_GraphicsMagick=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GraphicsMagickpp_GraphicsMagick" >&5
$as_echo "$ac_cv_lib_GraphicsMagickpp_GraphicsMagick" >&6; }
if test "x$ac_cv_lib_GraphicsMagickpp_GraphicsMagick" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGRAPHICSMAGICK___GRAPHICSMAGICK 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in GraphicsMagick++ GraphicsMagick
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_graphicsmagick=no
fi
if test "${osra_lib_graphicsmagick}" != "yes"; then :
as_fn_error $? "GraphicsMagick API check failed; make sure you have installed libgraphicsmagick++-dev and all dependent -dev packages or check config.log" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pnm_readpnminit" >&5
$as_echo_n "checking for library containing pnm_readpnminit... " >&6; }
if ${ac_cv_search_pnm_readpnminit+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$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 pnm_readpnminit ();
int
main ()
{
return pnm_readpnminit ();
;
return 0;
}
_ACEOF
for ac_lib in '' netpbm pnm; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_pnm_readpnminit=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_pnm_readpnminit+:} false; then :
break
fi
done
if ${ac_cv_search_pnm_readpnminit+:} false; then :
else
ac_cv_search_pnm_readpnminit=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pnm_readpnminit" >&5
$as_echo "$ac_cv_search_pnm_readpnminit" >&6; }
ac_res=$ac_cv_search_pnm_readpnminit
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
osra_lib_gocr=yes
ax_link_dynamically=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lPgm2asc" >&5
$as_echo_n "checking for -lPgm2asc... " >&6; }
if ${ac_cv_lib_Pgm2asc+:} false; then :
$as_echo_n "(cached) " >&6
else
{ LIBS_LIST=; unset LIBS_LIST;}
for ax_var in Pgm2asc
do :
LIBS_LIST="-l${ax_var} ${LIBS_LIST}"
done
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
ax_try_link_save_LIBS=${LIBS}
LIBS="${LIBS_LIST} ${LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern "C" {
#include
#include
}
job_t *OCR_JOB, *JOB;
int
main ()
{
job_t job;
job_init(&job);
job_init_image(&job);
job_free_image(&job);
pgm2asc(&job);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_Pgm2asc=yes
else
ac_cv_lib_Pgm2asc=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
if test "x$ac_cv_lib_Pgm2asc" = xno; then :
if test "${enable_static_linking+set}" == "set" -a "${ac_gnu_ld}" == "yes"; then :
ax_try_link_save_LIBS=${LIBS}
LIBS="-Wl,-Bdynamic ${LIBS_LIST} -Wl,-static ${LIBS}"
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" for dynamic library presence check" >&5
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern "C" {
#include
#include
}
job_t *OCR_JOB, *JOB;
int
main ()
{
job_t job;
job_init(&job);
job_init_image(&job);
job_free_image(&job);
pgm2asc(&job);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_Pgm2asc=yes
ax_link_dynamically=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=${ax_try_link_save_LIBS}
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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Pgm2asc" >&5
$as_echo "$ac_cv_lib_Pgm2asc" >&6; }
if test "x$ac_cv_lib_Pgm2asc" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPGM2ASC 1
_ACEOF
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-static ${LIBS}"
fi
for ax_var in Pgm2asc
do :
(echo "${LIBS}" | grep -q -- "-l${ax_var} ") || LIBS="-l${ax_var} ${LIBS}"
done
if test "${ax_link_dynamically}" == "yes"; then :
LIBS="-Wl,-Bdynamic ${LIBS}"
fi
$as_echo "$as_me:${as_lineno-$LINENO}: LIBS=\"${LIBS}\" after linking check succeeded" >&5
else
osra_lib_gocr=no
fi
if test "${osra_lib_gocr}" != "yes"; then :
as_fn_error $? "GOCR API check failed; make sure you have installed libgocr-dev package or check config.log" "$LINENO" 5
fi
LIB_PATCH_VERSION=`echo ${PACKAGE_VERSION} | perl -ne '/(\d+)\.(\d+)\.(\d+)/ || die; printf "%d%02d%02d", $1, $2, $3;'`
case "$build_os" in #(
darwin) :
LDSHAREDFLAGS='-dynamiclib -Wl,-dylib_install_name -Wl,$@.$(LIB_MAJOR_VERSION)'
SHAREDEXT=.dylib
;; #(
cygwin | mingw) :
LDSHAREDFLAGS='-shared -Wl,--kill-at -Wl,--out-implib,$@.a'
SHAREDEXT=.dll
;; #(
*) :
LDSHAREDFLAGS='-shared -Wl,-soname,$@.$(LIB_MAJOR_VERSION)'
SHAREDEXT=.so
;; #(
*) :
;;
esac
if test -n "${OPENMP_CXXFLAGS}" ; then :
CPPFLAGS="${OPENMP_CFLAGS} ${CPPFLAGS}"
CXXFLAGS="${OPENMP_CXXFLAGS} ${CXXFLAGS}"
fi
test "$prefix" = "NONE" && prefix=$ac_default_prefix
datadir=`eval echo "${datadir}"`
docdir=`eval echo "${docdir}"`
resolved_datadir=`eval echo "${datadir}"`
cat >>confdefs.h <<_ACEOF
#define DATA_DIR "$resolved_datadir"
_ACEOF
resolved_datadir=$resolved_datadir
PACKAGE_VERSION_WITH_DASHES=`echo ${PACKAGE_VERSION} | perl -ne '/(\d+)\.(\d+)\.(\d+)/ || die; printf "%d-%d-%d", $1, $2, $3;'`
ac_config_headers="$ac_config_headers src/config.h"
ac_config_files="$ac_config_files Makefile Makefile.inc doc/manual.sgml package/linux/osra.pc package/linux/debian/control package/linux/debian/rules package/linux/suse/osra.spec pom.xml package/linux/osra.sh package/linux/install.sh package/linux/install-user.sh package/osx/osra.sh package/osx/install.sh package/win32/osra.nsi"
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
: "${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 osra $as_me 2.1.3, 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"
_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
Report bugs to the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
osra config.status 2.1.3
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'
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
_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
"src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"Makefile.inc") CONFIG_FILES="$CONFIG_FILES Makefile.inc" ;;
"doc/manual.sgml") CONFIG_FILES="$CONFIG_FILES doc/manual.sgml" ;;
"package/linux/osra.pc") CONFIG_FILES="$CONFIG_FILES package/linux/osra.pc" ;;
"package/linux/debian/control") CONFIG_FILES="$CONFIG_FILES package/linux/debian/control" ;;
"package/linux/debian/rules") CONFIG_FILES="$CONFIG_FILES package/linux/debian/rules" ;;
"package/linux/suse/osra.spec") CONFIG_FILES="$CONFIG_FILES package/linux/suse/osra.spec" ;;
"pom.xml") CONFIG_FILES="$CONFIG_FILES pom.xml" ;;
"package/linux/osra.sh") CONFIG_FILES="$CONFIG_FILES package/linux/osra.sh" ;;
"package/linux/install.sh") CONFIG_FILES="$CONFIG_FILES package/linux/install.sh" ;;
"package/linux/install-user.sh") CONFIG_FILES="$CONFIG_FILES package/linux/install-user.sh" ;;
"package/osx/osra.sh") CONFIG_FILES="$CONFIG_FILES package/osx/osra.sh" ;;
"package/osx/install.sh") CONFIG_FILES="$CONFIG_FILES package/osx/install.sh" ;;
"package/win32/osra.nsi") CONFIG_FILES="$CONFIG_FILES package/win32/osra.nsi" ;;
*) 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
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 "
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
_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
$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
;;
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: Now you can run \"make all install\" to compile and install the application." >&5
$as_echo "$as_me: Now you can run \"make all install\" to compile and install the application." >&6;}
osra-2.1.3/src/ 0000775 0001750 0001750 00000000000 14115175251 011736 5 ustar igor igor osra-2.1.3/src/osra_fragments.cpp 0000664 0001750 0001750 00000014346 14115175251 015464 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
// File osra_fragments.cpp
//
// Defines operations on molecular fragments
//
#include // FLT_MAX
#include // INT_MAX
#include // std::ostream, std::cout
#include "osra.h"
#include "osra_common.h"
#include "osra_fragments.h"
double atom_distance(const std::vector &atom, int a, int b)
{
return (distance(atom[a].x, atom[a].y, atom[b].x, atom[b].y));
}
/**
* TODO: Returning the vector from the stack causes copy constructor to trigger, which is inefficient.
* Consider passing the vector as a reference.
*/
std::vector > find_fragments(
const std::vector &bond, int n_bond, const std::vector &atom)
{
std::vector > frags;
std::vector pool;
int n = 0;
for (int i = 0; i < n_bond; i++)
if (bond[i].exists && atom[bond[i].a].exists && atom[bond[i].b].exists)
pool.push_back(i);
while (!pool.empty())
{
frags.resize(n + 1);
frags[n].push_back(bond[pool.back()].a);
frags[n].push_back(bond[pool.back()].b);
pool.pop_back();
bool found = true;
while (found)
{
found = false;
unsigned int i = 0;
while (i < pool.size())
{
bool found_a = false;
bool found_b = false;
bool newfound = false;
for (unsigned int k = 0; k < frags[n].size(); k++)
{
if (frags[n][k] == bond[pool[i]].a)
found_a = true;
else if (frags[n][k] == bond[pool[i]].b)
found_b = true;
}
if (found_a && !found_b)
{
frags[n].push_back(bond[pool[i]].b);
pool.erase(pool.begin() + i);
found = true;
newfound = true;
}
if (!found_a && found_b)
{
frags[n].push_back(bond[pool[i]].a);
pool.erase(pool.begin() + i);
found = true;
newfound = true;
}
if (found_a && found_b)
{
pool.erase(pool.begin() + i);
newfound = true;
}
if (!newfound)
i++;
}
}
n++;
}
return (frags);
}
int reconnect_fragments(std::vector &bond, int n_bond, std::vector &atom, double avg)
{
std::vector > frags = find_fragments(bond, n_bond, atom);
if (frags.size() <= 3)
{
for (unsigned int i = 0; i < frags.size(); i++)
if (frags[i].size() > 2)
for (unsigned int j = i + 1; j < frags.size(); j++)
if (frags[j].size() > 2)
{
double l = FLT_MAX;
int atom1 = 0, atom2 = 0;
for (unsigned int ii = 0; ii < frags[i].size(); ii++)
for (unsigned int jj = 0; jj < frags[j].size(); jj++)
{
double d = atom_distance(atom, frags[i][ii], frags[j][jj]);
if (d < l)
{
l = d;
atom1 = frags[i][ii];
atom2 = frags[j][jj];
}
}
if (l < 1.1 * avg && l > avg / 3)
{
//cout< populate_fragments(
const std::vector > &frags, const std::vector &atom)
{
std::vector r;
for (unsigned int i = 0; i < frags.size(); i++)
{
fragment_t f;
f.x1 = INT_MAX;
f.x2 = 0;
f.y1 = INT_MAX;
f.y2 = 0;
for (unsigned j = 0; j < frags[i].size(); j++)
{
f.atom.push_back(frags[i][j]);
if (atom[frags[i][j]].min_x < f.x1)
f.x1 = atom[frags[i][j]].min_x;
if (atom[frags[i][j]].max_x > f.x2)
f.x2 = atom[frags[i][j]].max_x;
if (atom[frags[i][j]].min_y < f.y1)
f.y1 = atom[frags[i][j]].min_y;
if (atom[frags[i][j]].max_y > f.y2)
f.y2 = atom[frags[i][j]].max_y;
//cout<<"Atoms2: "< bb.y2)
return (false);
if (aa.x1 > bb.x1)
return (false);
if (aa.x1 < bb.x1)
return (true);
return (false);
}
osra-2.1.3/src/config.h.in 0000664 0001750 0001750 00000003001 14115175251 013753 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
/* Tell CImg library that there is not going to be a X11-capable display attached. It doesn't matter for Linux hosts, but matters for OS X. */
#define cimg_display_type 0
/* 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 version of this package. */
#undef PACKAGE_VERSION
/* Define the location of data files. */
#undef DATA_DIR
/* Is tesseract library present? */
#undef HAVE_TESSERACT_LIB
/* Is cuneiform library present? */
#undef HAVE_CUNEIFORM_LIB
osra-2.1.3/src/osra_grayscale.cpp 0000664 0001750 0001750 00000024330 14115175251 015442 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
// File: osra_grayscale.cpp
//
// Defines grayscale conversion functions
//
#include
#include // std::ostream, std::cout
#include // fabs(double)
#include "osra.h"
#include "osra_grayscale.h"
const Color getBgColor(const Image &image)
{
ColorGray c, r;
r = image.pixelColor(1, 1);
for (int i = 0; i < BG_PICK_POINTS; i++)
{
double a = (double)rand()/RAND_MAX;
double b = (double)rand()/RAND_MAX;
int x = int(image.columns() *a);
int y = int(image.rows() * b);
c = image.pixelColor(x, y);
if (c.shade() > r.shade())
r = c;
}
return (r);
}
void otsu_find_peaks(const std::vector &h, int num_bins, int &peak1, int &peak2, int &max1, int &max2)
{
// Otsu Algorithm, from http://habrahabr.ru/blogs/algorithm/112079/
unsigned int m = 0;
unsigned int n = 0;
double maxSigma = -1;
unsigned int min_t = num_bins;
unsigned int alpha1 = 0;
unsigned int beta1 = 0;
for (unsigned int i = 0; i maxSigma)
{
maxSigma = sigma;
min_t = t;
}
}
max1 = 0;
peak1 = 0;
for (unsigned int i = 0; i<=min_t; i++)
if (h[i] > max1)
{
max1 = h[i];
peak1 = i;
}
max2 = 0;
peak2 = 0;
for (unsigned int i = min_t+1; i max2)
{
max2 = h[i];
peak2 = i;
}
}
Image adaptive_otsu(const Image &image, int window)
{
int num_bins=20;
Image result(Geometry(image.columns(),image.rows()),"white");
std::vector h(num_bins,0);
std::vector h0(num_bins,0);
ColorGray g;
int peak1, peak2, max1, max2;
for (int i1 = 0; i1 < std::min((int)image.columns(), window/2); i1++)
for (int j1 = 0; j1 < std::min((int)image.rows(), window/2); j1++)
{
g = image.pixelColor(i1, j1);
h0[int((num_bins-1)*g.shade())]++;
}
for (int j = 0; j < image.rows(); j++)
{
for (int k = 0; k median)
result.pixelColor(i,j,"white");
else
result.pixelColor(i,j,"black");
if ((i-window/2) >=0)
for (int j1 = std::max(0, j-window/2); j1 < std::min((int)image.rows(), j + window/2); j1++)
{
g = image.pixelColor(i-window/2, j1);
h[int((num_bins-1)*g.shade())]--;
}
if ((i+window/2) < image.columns())
for (int j1 = std::max(0, j-window/2); j1 < std::min((int)image.rows(), j + window/2); j1++)
{
g = image.pixelColor(i+window/2, j1);
h[int((num_bins-1)*g.shade())]++;
}
}
if ((j-window/2) >=0)
for (int i1 = 0; i1 < std::min((int)image.columns(), window/2); i1++)
{
g = image.pixelColor(i1,j-window/2);
h0[int((num_bins-1)*g.shade())]--;
}
if ((j+window/2) < image.rows())
for (int i1 = 0; i1 < std::min((int)image.columns(), window/2); i1++)
{
g = image.pixelColor(i1,j+window/2);
h0[int((num_bins-1)*g.shade())]++;
}
}
return(result);
}
// https://habrahabr.ru/post/278435/
Image Bradley_threshold(const Image &src)
{
int width = src.columns();
int height = src.rows();
Image res(Geometry(width, height),"white");
const int S = width/8;
int s2 = S/2;
const float t = 0.15;
unsigned long* integral_image = 0;
long sum=0;
int count=0;
int index;
int x1, y1, x2, y2;
ColorGray g;
integral_image = new unsigned long [width*height*sizeof(unsigned long*)];
for (int i = 0; i < width; i++) {
sum = 0;
for (int j = 0; j < height; j++) {
index = j * width + i;
g = src.pixelColor(i, j);
sum += g.shade() * 255;
if (i==0)
integral_image[index] = sum;
else
integral_image[index] = integral_image[index-1] + sum;
}
}
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
index = j * width + i;
x1=i-s2;
x2=i+s2;
y1=j-s2;
y2=j+s2;
if (x1 < 0)
x1 = 0;
if (x2 >= width)
x2 = width-1;
if (y1 < 0)
y1 = 0;
if (y2 >= height)
y2 = height-1;
count = (x2-x1)*(y2-y1);
sum = integral_image[y2*width+x2] - integral_image[y1*width+x2] -
integral_image[y2*width+x1] + integral_image[y1*width+x1];
g = src.pixelColor(i, j);
if ((long)(g.shade() * 255 * count) < (long)(sum*(1.0-t)))
res.pixelColor(i,j,"black");
else
res.pixelColor(i,j,"white");
}
}
delete[] integral_image;
return res;
}
bool convert_to_gray(Image &image, bool invert, bool adaptive, bool verbose)
{
int num_bins=50;
int num_bins_rgb = 20;
std::vector h(num_bins,0);
std::vector > > bg_search(num_bins_rgb, std::vector > (num_bins_rgb, std::vector(num_bins_rgb, 0)));
ColorRGB c,b;
Color t;
ColorGray g;
double a;
image.type(TrueColorMatteType);
for (int i = 0; i < BG_PICK_POINTS; i++)
{
double a = (double) rand() / RAND_MAX;
double b = (double) rand() / RAND_MAX;
int x = int(image.columns() * a);
int y = int(image.rows() * b);
c = image.pixelColor(x, y);
bg_search[int((num_bins_rgb-1)*c.red())][int((num_bins_rgb-1)*c.green())][int((num_bins_rgb-1)*c.blue())]++;
}
int bg_peak = 0;
double bg_pos_red = 0, bg_pos_green = 0, bg_pos_blue = 0;
for (int i=0; i bg_peak)
{
bg_peak = bg_search[i][j][k];
bg_pos_red = (double)i/(num_bins_rgb-1);
bg_pos_green = (double)j/(num_bins_rgb-1);
bg_pos_blue = (double)k/(num_bins_rgb-1);
}
bool color_background = false;
if (verbose)
{
std::cout << "Background rgb: " << bg_pos_red << " " << bg_pos_green << " " << bg_pos_blue << std::endl;
}
if (fabs(bg_pos_red-bg_pos_green) > 0.05 || fabs(bg_pos_red-bg_pos_blue)>0.05 || fabs(bg_pos_green-bg_pos_blue)>0.05) color_background = true;
bool matte = image.matte();
if (color_background)
{
image.contrast(2);
image.type(GrayscaleType);
}
for (unsigned int i = 0; i < image.columns(); i++)
for (unsigned int j = 0; j < image.rows(); j++)
{
t = image.pixelColor(i, j);
b = t;
g = t;
if (matte && t.alpha() == 1 && g.shade() < 0.5)
{
g.shade(1);
image.pixelColor(i, j, g);
}
else if (!color_background &&
(fabs(b.red()-b.green()) > 0.1 || fabs(b.red()-b.blue()) > 0.1 || fabs(b.blue()-b.green()) > 0.1))
{
if (fabs(b.red()-bg_pos_red) >= fabs(b.green()-bg_pos_green) && fabs(b.red()-bg_pos_red) >= fabs(b.blue()-bg_pos_blue))
a = b.red();
else if (fabs(b.red()-bg_pos_red) < fabs(b.green()-bg_pos_green) && fabs(b.green()-bg_pos_green) >= fabs(b.blue()-bg_pos_blue))
a = b.green();
else
a = b.blue();
c.red(a);
c.green(a);
c.blue(a);
image.pixelColor(i, j, c);
}
g = image.pixelColor(i, j);
h[int((num_bins-1)*g.shade())]++;
}
int peak1, peak2, max1, max2;
otsu_find_peaks(h,num_bins,peak1,peak2, max1, max2);
double distance_between_peaks = (double)(peak2-peak1)/(num_bins-1);
// if (distance_between_peaks < THRESHOLD_GLOBAL) adaptive = true;
if (distance_between_peaks < 0.5) adaptive = true;
if (max1 > max2 || invert)
invert = true;
if (verbose)
{
std::cout << "Distance between light and dark: " << distance_between_peaks << std::endl;
std::cout << "Max at peak 1: " << max1 << " Max at peak 2: " << max2 << std::endl;
std::cout << "Color background? "<< color_background << std::endl;
std::cout << "Adaptive? "<< adaptive << std::endl;
std::cout << "Invert? " << invert << std::endl;
}
//const double kernel[]={0.0, -1.0, 0.0,-1.0, 5.0, -1.0, 0.0, -1.0, 0.0};
//image.convolve(3,kernel);
if (!color_background)
{
image.contrast(2);
image.type(GrayscaleType);
}
int window = std::min(image.columns(),image.rows()) / 41;
if (window < 15) window = 15;
if (adaptive && image.columns() > 7 && image.rows() > 7)
{
image.despeckle();
if (invert)
{
image.adaptiveThreshold(window,window,7.0);
}
else
{
image.negate();
image.adaptiveThreshold(window,window,7.0);
image.negate();
}
}
else if (color_background)
{
image.despeckle();
//image = adaptive_otsu(image,window);
image = Bradley_threshold(image);
}
if (invert)
image.negate();
// image.write("tmp.png");
return(adaptive);
}
osra-2.1.3/src/osra_ocr.cpp 0000664 0001750 0001750 00000041501 14115175251 014252 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
#include // strlen(), memset()
#include // isalnum(), isspace()
#include // std:vector
#include // std::cout
#include "osra_common.h"
#include "config.h"
extern "C" {
#include
}
#include
#include "osra.h"
#include "osra_ocr.h"
#ifdef HAVE_CUNEIFORM_LIB
#include
#endif
#ifdef HAVE_TESSERACT_LIB
// We can't push these functions into this cpp file, as the types from Tesseract conflict with GOCR
void osra_tesseract_init();
void osra_tesseract_destroy();
char osra_tesseract_ocr(unsigned char *pixel_map, int width, int height, const std::string &char_filter);
#endif
// Global GOCR variable (omg) both for 0.48-0.49 and 0.50 versions:
job_t *JOB;
job_t *OCR_JOB;
// Also declared in osra_ocr_tesseract.cpp:
const char UNKNOWN_CHAR = '_';
/**
* THRESHOLD is the graylevel binarization threshold.
* dropx and dropy are the coordinates for the starting point from where the connected component (the image of the character) will be searched for.
* Very often there is no bounding rectangle that would exclude all extraneous pieces without cutting into the character itself.
* Those pieces confuse the OCR libraries quite a bit, so it's better to extract connected components (all characters that OSRA needs to resolve
* are luckily single connected components) and leave the extra bits out.
*/
void osra_ocr_init()
{
#ifdef HAVE_CUNEIFORM_LIB
// Initialization for Cuneiform library should be called only once. Otherwise it breaks down during deinitialization:
int langcode = PUMA_LANG_ENGLISH;
PumaBool dotmatrix = 0;
PumaBool fax = 0;
PumaBool onecolumn = 1;
PUMA_Init(0, 0);
PUMA_SetImportData(PUMA_Word32_Language, &langcode);
PUMA_SetImportData(PUMA_PumaBool32_DotMatrix, &dotmatrix);
PUMA_SetImportData(PUMA_PumaBool32_Fax100, &fax);
PUMA_SetImportData(PUMA_PumaBool32_OneColumn, &onecolumn);
#endif
#ifdef HAVE_TESSERACT_LIB
osra_tesseract_init();
#endif
}
void osra_ocr_destroy()
{
#ifdef HAVE_CUNEIFORM_LIB
PUMA_Done();
#endif
#ifdef HAVE_TESSERACT_LIB
osra_tesseract_destroy();
#endif
}
// Function: osra_gocr_ocr()
// Make an attempt to OCR the image box with GOCR engine.
//
// Parameters:
// job_t - includes pixel map and character filter
//
// Returns:
// 0 in case the recognition failed or valid alphanumeric character
char osra_gocr_ocr(job_t &gocr_job)
{
OCR_JOB = &gocr_job;
JOB = &gocr_job;
// cout<<"Before gocr"<data;
if (l != NULL && strlen(l) == 1 && isalnum(l[0]))
return l[0];
return UNKNOWN_CHAR;
}
// Function: osra_ocrad_ocr()
// Make an attempt to OCR the image box with OCRAD engine.
//
// Parameters:
// ocrad_pixmap - includes pixel map and the image mode
// char_filter - character filter
//
// Returns:
// 0 in case the recognition failed or valid alphanumeric character
char osra_ocrad_ocr(const OCRAD_Pixmap * const ocrad_pixmap, const std::string &char_filter)
{
char result = 0;
std::string line;
OCRAD_Descriptor * const ocrad_res = OCRAD_open();
// If the box height is less than 10px, it should be scaled up a bit, otherwise OCRAD is unable to catch it:
if (ocrad_res && OCRAD_get_errno(ocrad_res) == OCRAD_ok && OCRAD_set_image(ocrad_res, ocrad_pixmap, 0) == 0
&& (ocrad_pixmap->height >= 10 || OCRAD_scale(ocrad_res, 2) == 0) && OCRAD_recognize(ocrad_res, 0) == 0)
{
result = OCRAD_result_first_character(ocrad_res);
if (OCRAD_result_blocks(ocrad_res) >= 1 && OCRAD_result_lines(ocrad_res, 0) && OCRAD_result_line(
ocrad_res, 0, 0) != 0)
line = OCRAD_result_line(ocrad_res, 0, 0);
}
OCRAD_close(ocrad_res);
// TODO: Why line should have 0 or 1 characters? Give examples...
if (line.length() > 2 || !isalnum(result) || (!char_filter.empty() && char_filter.find(result, 0) == std::string::npos))
return UNKNOWN_CHAR;
return result;
}
// Function: osra_cuneiform_ocr()
// Make an attempt to OCR the image box with Cuneiform engine.
//
// Parameters:
// cuneiform_img - pixel map
// verbose - if set, then output intermediate results
// char_filter - character filter
//
// Returns:
// 0 in case the recognition failed or valid alphanumeric character
#ifdef HAVE_CUNEIFORM_LIB
char osra_cuneiform_ocr(Magick::Image &cuneiform_img, const std::string &char_filter)
{
Magick::Blob blob;
cuneiform_img.write(&blob, "DIB");
size_t data_size = blob.length();
char *dib = new char[data_size];
memcpy(dib, blob.data(), data_size);
char str[256];
memset(str, 0, sizeof(str));
if (!PUMA_XOpen(dib, NULL) || !PUMA_XFinalRecognition() || !PUMA_SaveToMemory(NULL, PUMA_TOTEXT, PUMA_CODE_ASCII, str, sizeof(str) - 1))
{
//if (verbose)
// cout << "Cuneiform recognition failed." << endl;
PUMA_XClose();
delete []dib;
return UNKNOWN_CHAR;
}
PUMA_XClose();
delete []dib;
// As we have initialized the image with two identical samples, it is expected that they go in the string
// one after another, or separated by space (e.g. "ZZ\n" or "Z Z\n").
if (((str[0] == str[1] && isspace(str[2])) || (str[0] == str[2] && str[1] == ' ')) && isalnum(str[0])
&& (char_filter.empty() || char_filter.find(str[0], 0) != std::string::npos))
return str[0];
return UNKNOWN_CHAR;
}
#endif
char get_atom_label(const Magick::Image &image, const Magick::ColorGray &bg, int x1, int y1, int x2, int y2,
double THRESHOLD, int dropx, int dropy, bool no_filtering, bool verbose, bool numbers,
const std::string &recognized_chars)
{
char c = UNKNOWN_CHAR;
const int width = x2 - x1 + 1;
const int height = y2 - y1 + 1;
unsigned char *pixmap = (unsigned char *) malloc(width * height);
for (int i = y1; i <= y2; i++)
for (int j = x1; j <= x2; j++)
pixmap[(i - y1) * width + j - x1] = (unsigned char) (255 - 255 * get_pixel(image, bg, j, i, THRESHOLD));
// Here we drop down from the top of the box, middle of x coordinate and extract connected component
int t = 1;
int y = dropy - y1 + 1;
int x = dropx - x1;
while ((t != 0) && (y < height))
{
t = pixmap[y * width + x];
y++;
}
if (t != 0)
{
free(pixmap);
return 0;
}
#pragma omp critical
{
y--;
pixmap[y * width + x] = 2;
std::list cx;
std::list cy;
cx.push_back(x);
cy.push_back(y);
while (!cx.empty())
{
x = cx.front();
y = cy.front();
cx.pop_front();
cy.pop_front();
pixmap[y * width + x] = 1;
// this goes around 3x3 square touching the chosen pixel
for (int i = x - 1; i < x + 2; i++)
for (int j = y - 1; j < y + 2; j++)
if (i < width && j < height && i >= 0 && j >= 0 && pixmap[j * width + i] == 0)
{
cx.push_back(i);
cy.push_back(j);
pixmap[j * width + i] = 2;
}
}
// Flatten the bitmap. Note: the bitmap is inverted after this cycle (255 means "empty", 0 means "pixel").
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++)
pixmap[i * width + j] = (pixmap[i * width + j] == 1 ? 0 : 255);
job_t gocr_job;
// The list of all characters, that can be recognised as atom label:
std::string char_filter = RECOGNIZED_CHARS;
if (!recognized_chars.empty())
char_filter = recognized_chars;
if (numbers) char_filter = "1";
if (no_filtering) char_filter.clear();
job_init(&gocr_job);
job_init_image(&gocr_job);
//gocr_job.cfg.cs = 160;
//gocr_job.cfg.certainty = 80;
//gocr_job.cfg.dust_size = 1;
gocr_job.src.p.x = width;
gocr_job.src.p.y = height;
gocr_job.src.p.bpp = 1;
gocr_job.src.p.p = pixmap;
if (char_filter.empty())
gocr_job.cfg.cfilter = (char*)NULL;
else
gocr_job.cfg.cfilter = (char*) char_filter.c_str();
struct OCRAD_Pixmap *ocrad_pixmap = new OCRAD_Pixmap();
unsigned char *ocrad_bitmap = (unsigned char *) malloc(width * height);
memset(ocrad_bitmap, 0, width * height);
ocrad_pixmap->height = height;
ocrad_pixmap->width = width;
ocrad_pixmap->mode = OCRAD_bitmap;
ocrad_pixmap->data = ocrad_bitmap;
// Number of non-zero pixels on the bitmap, excluding the 1px border:
int pixmap_pixels_count = 0;
// Number of zero pixels on the bitmap, excluding the 1px border:
int pixmap_zeros_count = 0;
// The code below initialises "opix->data" buffer ("bitmap_data") for OCRAD from "tmp" buffer:
#ifdef HAVE_CUNEIFORM_LIB
Magick::Image cuneiform_img(Magick::Geometry(2 * width + 2, height), "white");
// From cuneiform_src/cli/cuneiform-cli.cpp::preprocess_image(Magick::Image&):168
cuneiform_img.monochrome();
cuneiform_img.type(Magick::BilevelType);
#endif
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
if (pixmap[y * width + x] == 0)
{
ocrad_bitmap[y * width + x] = 1;
#ifdef HAVE_CUNEIFORM_LIB
// Draw two identical samples that follow one another. We do so because Cuneiform has difficulties in recognizing single characters:
cuneiform_img.pixelColor(x, y, "black");
cuneiform_img.pixelColor(x + width + 2, y, "black");
#endif
if (x > 0 && x < width - 1 && y > 0 && y < height - 1)
pixmap_pixels_count++;
}
else if (x > 0 && x < width - 1 && y > 0 && y < height - 1)
pixmap_zeros_count++;
}
}
if (verbose)
{
std::cout << "Box to OCR: " << x1 << "x" << y1 << "-" << x2 << "x" << y2 << " w/h: " << width << "x" << height << std::endl;
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
std::cout << (gocr_job.src.p.p[i * width + j] / 255 ? '#' : '.');
std::cout << std::endl;
}
}
if (pixmap_pixels_count <= MIN_CHAR_POINTS || pixmap_zeros_count <= MIN_CHAR_POINTS)
goto FINALIZE;
c = osra_gocr_ocr(gocr_job);
if (verbose)
std::cout << "GOCR: c=" << c << std::endl;
//c = UNKNOWN_CHAR; // Switch off GOCR recognition
// Character recognition succeeded for GOCR:
if (c != UNKNOWN_CHAR)
goto FINALIZE;
// Character recognition failed for GOCR and we try OCRAD:
c = osra_ocrad_ocr(ocrad_pixmap, char_filter);
if (verbose)
std::cout << "OCRAD: c=" << c << std::endl;
//c = UNKNOWN_CHAR; // Switch off OCRAD recognition
// Character recognition succeeded for OCRAD:
if (c != UNKNOWN_CHAR)
goto FINALIZE;
#ifdef HAVE_TESSERACT_LIB
c = osra_tesseract_ocr(gocr_job.src.p.p, width, height, char_filter);
if (verbose)
std::cout << "Tesseract: c=" << c << std::endl;
//c = UNKNOWN_CHAR; // Switch off Tesseract recognition
// Character recognition succeeded for Tesseract:
if (c != UNKNOWN_CHAR)
goto FINALIZE;
#endif
#ifdef HAVE_CUNEIFORM_LIB
// TODO: Why box width should be more than 7 for Cuneiform?
if (width <= 7)
goto FINALIZE;
c = osra_cuneiform_ocr(cuneiform_img, char_filter);
if (verbose)
std::cout << "Cuneiform: c=" << c << std::endl;
//c = UNKNOWN_CHAR; // Switch off Cuneiform recognition
#endif
FINALIZE:
// "pixmap" is freed together with "gocr_job".
job_free_image(&gocr_job);
OCR_JOB = NULL;
JOB = NULL;
delete ocrad_pixmap; // delete OCRAD Pixmap
free(ocrad_bitmap);
// TODO: Why there are problems with "7" with a given box size? If the problem is engine-specific, it should be moved to appropriate section
if (c == '7' && (width <= 10 || height <= 20))
c = UNKNOWN_CHAR;
} // #pragma omp critical
return(c == UNKNOWN_CHAR ? 0 : c);
}
bool detect_square_bracket(unsigned char *pic, int x, int y)
{
int w = -1;
for (int j = x / 2; j >= 0 ; j--)
{
if (pic[(y / 2) * x + j] == 1)
{
w = j;
break;
}
}
int h1 = -1;
for (int i = y / 2; i >= 0; i--)
{
if (pic[i * x + x / 2] == 1)
{
h1 = i;
break;
}
}
int h2 = y;
for (int i = y / 2; i < y; i++)
{
if (pic[i * x + x / 2] == 1)
{
h2 = i;
break;
}
}
if (w > x /2 + 1 || h1 > y / 4 || (y - h2) > y / 4)
return false;
int total_vert(0), total_up_hor(0), total_down_hor(0), fill_vert(0), fill_up_hor(0), fill_down_hor(0), total_empty(0), fill_empty(0);
for (int i = 0; i < y; i++)
{
for (int j = 0; j < x; j++)
{
bool fill = (pic[i * x + j] == 1);
if (j <= w)
{
total_vert++;
if (fill)
fill_vert++;
}
if (i <= h1)
{
total_up_hor++;
if (fill)
fill_up_hor++;
}
if (i >= h2)
{
total_down_hor++;
if (fill)
fill_down_hor++;
}
if (j > w && i > h1 && i < h2)
{
total_empty++;
if (fill)
fill_empty++;
}
}
}
if (total_vert == 0 || total_up_hor == 0 || total_down_hor == 0 || total_empty == 0)
return false;
double fill_v = double(fill_vert) / total_vert;
double fill_up_h = double(fill_up_hor) / total_up_hor;
double fill_down_h = double(fill_down_hor) / total_down_hor;
double fill_e = double(fill_empty) / total_empty;
if (fill_v > 0.8 && fill_up_h > 0.7 && fill_down_h > 0.7 && fill_e < 0.2)
return true;
return false;
}
bool detect_bracket(int x, int y, unsigned char *pic)
{
bool res = false;
#pragma omp critical
{
char c1 = 0;
job_t job;
JOB = &job;
OCR_JOB = &job;
job_init(&job);
job_init_image(&job);
job.cfg.cfilter = (char *) "([{";
//job.cfg.cs = 160;
//job.cfg.certainty = 80;
//job.cfg.dust_size = 1;
job.src.p.x = x;
job.src.p.y = y;
job.src.p.bpp = 1;
job.src.p.p = pic;
struct OCRAD_Pixmap *ocrad_pixmap = new OCRAD_Pixmap();
unsigned char *ocrad_bitmap = (unsigned char *) malloc(x * y);
memset(ocrad_bitmap, 0, x * y);
ocrad_pixmap->height = y;
ocrad_pixmap->width = x;
ocrad_pixmap->mode = OCRAD_bitmap;
ocrad_pixmap->data = ocrad_bitmap;
int count = 0;
int zeros = 0;
for (int i = 0; i < y; i++)
{
for (int j = 0; j < x; j++)
{
if (pic[i * x + j] == 0)
{
ocrad_bitmap[i * x + j] = 1;
count++;
}
else
zeros++;
}
}
/*std::string str;
for (int i = 0; i < y; i++)
{
for (int j = 0; j < x; j++)
{
str += (pic[i * x + j] != 0 ? "#" : ".");
}
str += "\n";
}
std::cout << str << std::endl;
*/
if (count > MIN_CHAR_POINTS && zeros > MIN_CHAR_POINTS)
{
try
{
pgm2asc(&job);
}
catch (...) { }
char *l;
l = (char *) job.res.linelist.start.next->data;
if (l != NULL)
c1 = l[0];
if (c1 == '(' || c1 == '[' || c1 == '{')
res = true;
else
{
char c2 = osra_ocrad_ocr(ocrad_pixmap, "([{");
if (c2 == '(' || c2 == '[' || c2 == '{')
res = true;
}
}
if (!res)
res = detect_square_bracket(ocrad_bitmap, x, y);
/*
if (res)
{
std::cout << "Found! " << c1 << std::endl;
}
*/
delete ocrad_pixmap;
free(ocrad_bitmap);
job_free_image(&job);
OCR_JOB = NULL;
JOB = NULL;
}
return (res);
}
const std::string fix_atom_name(const std::string &s, int n,
const std::map &fix,
const std::map &superatom, bool debug)
{
std::string r = s;
if (s.length() == 1)
r = toupper(s.at(0));
if (s == "H" && n > 1)
r = "N";
std::map::const_iterator it = fix.find(s);
std::string mapped = " ";
if (it != fix.end())
{
r = it->second;
mapped = r;
}
if (debug && s != " " && s != "")
{
it = superatom.find(r);
std::string smiles = " ";
if (it != superatom.end())
smiles = it->second;
std::cout << s << " --> " << mapped << " --> " << smiles << std::endl;
}
return (r);
}
osra-2.1.3/src/osra_ocr.h 0000664 0001750 0001750 00000006062 14115175251 013722 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
// Header: osra_ocr.h
//
// Defines types and functions for OSRA OCR module.
//
#include // std::string
#include // std::map
#include // Magick::Image, Magick::ColorGray
//
// Section: Functions
//
// Function: osra_ocr_init()
//
// Initialises OCR engine. Should be called at e.g. program startup.
//
void osra_ocr_init();
// Function: osra_ocr_destroy()
//
// Releases all resources allocated by OCR engine.
//
void osra_ocr_destroy();
// Function: get_atom_label()
//
// OCR engine function, does single character recognition
//
// Parameters:
// image - image object
// bg - gray-level background color
// x1, y1, x2, y2 - coordinates of the character box
// THRESHOLD - graylevel threshold for image binarization
// dropx, dropy - coordinates of drop point from where breadth-first algorithm will search for single connected component
// which is hopefully the character we are trying to recognize
// no_filtering - do not apply character filter
// numbers - only allow numbers in the output 0..9
// recognized_chars - user-supplied ocr filter
//
// Returns:
// recognized character or 0
char get_atom_label(const Magick::Image &image, const Magick::ColorGray &bg, int x1, int y1, int x2, int y2,
double THRESHOLD, int dropx, int dropy, bool no_filtering, bool verbose, bool numbers = false, const std::string &recognized_chars="");
// Function: fix_atom_name()
//
// Corrects common OCR errors by using spelling dictionary
//
// Parameters:
// s - Original atomic label as returned by OCR engine.
// n - The number of bonds attached to the atom.
// fix - spelling dictionary
// superatom - dictionary of superatom labels mapped to SMILES
// debug - enables output of debugging information to stdout
//
// Returns:
// corrected atomic label
const std::string fix_atom_name(const std::string &s, int n, const std::map &fix,
const std::map &superatom, bool debug);
bool detect_bracket(int x, int y, unsigned char *pic);
osra-2.1.3/src/osra.h 0000664 0001750 0001750 00000017431 14115175251 013061 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
// Header: osra.h
//
// Defines types and functions exported from main module to other modules.
//
#ifndef OSRA_H
#define OSRA_H
#include // std:string
#include // std::vector
#include // Magick::Image, Magick::ColorGray
extern "C" {
#include
}
using namespace Magick;
// struct: atom_s
// Contains information about perspective atom
struct atom_s
{
atom_s(double xx=0, double yy=0, const potrace_path_t* p=NULL) :
x(xx),y(yy),min_x(xx),min_y(yy),max_x(xx),max_y(yy),curve(p),label(" "),n(0),anum(0), exists(false),corner(false),terminal(false),charge(0) {}
// doubles: x, y
// coordinates within the image clip
double x, y;
// string: label
// atomic label
std::string label;
// int: n
// counter of created OBAtom objects in
int n;
// int: anum
// atomic number
int anum;
// pointer: curve
// pointer to the curve found by Potrace
const potrace_path_t *curve;
// bools: exists, corner, terminal
// atom exists, atom is at the corner (has two bonds leading to it), atom is a terminal atom
bool exists, corner, terminal;
// int: charge
// electric charge on the atom
int charge;
// int: min_x, min_y, max_x, max_y
// box coordinates
int min_x, min_y,max_x,max_y;
};
// typedef: atom_t
// defines atom_t type based on atom_s struct
typedef struct atom_s atom_t;
// struct: bond_s
// contains information about perspective bond between two atoms
struct bond_s
{
bond_s(int i=0, int j=0, const potrace_path_t* p=NULL) :
a(i),b(j),curve(p),type(1),exists(true),hash(false),wedge(false),up(false),down(false),Small(false),arom(false),conjoined(false) {}
// ints: a, b, type
// starting atom, ending atom, bond type (1=single, 2=double, 3=triple)
int a, b, type;
// pointer: curve
// pointer to the curve found by Potrace
const potrace_path_t *curve;
// bools: exists, hash, wedge, up, down, Small, arom
// bond existence and type flags
bool exists;
bool hash;
bool wedge;
bool up;
bool down;
bool Small;
bool arom;
// bool: conjoined
// true for a double bond which is joined at one end on the image
bool conjoined;
};
// typedef: bond_t
// defines bond_t type based on bond_s struct
typedef struct bond_s bond_t;
// Section: Constants
//
// Constants: global defines
//
// MAX_ATOMS - maximum size of the vector holding perspective atoms
// MAX_FONT_HEIGHT - maximum font height at a resolution of 150 dpi
// MAX_FONT_WIDTH - maximum font width at a resolution of 150 dpi
// MIN_FONT_HEIGHT - minimum font height
// BG_PICK_POINTS - number of points to randomly pick to determine background color
// D_T_TOLERANCE - cosine tolerance to find parallel bonds for double-triple bond extraction
// V_DISPLACEMENT - threshold vertical displacement in pixels
// DIR_CHANGE - threshold direction change in pixels
// THRESHOLD_GLOBAL - gray-level threshold for image binarization
// THRESHOLD_LOW_RES - gray-level threshold for low resolutions (72 dpi)
// MAX_RATIO - maximum black/white fill ratio for perspective molecular structures
// MIN_ASPECT - minimum aspect ration
// MAX_ASPECT - maximum aspect ratio
// MIN_A_COUNT - minimum number of atoms
// MAX_A_COUNT - maximum number of atoms
// MIN_B_COUNT - minimum number of bonds
// MAX_B_COUNT - maximum number of bonds
// MIN_CHAR_POINTS - minimum number of black and white pixels in a character box
// MAX_BOND_THICKNESS - maximum bond thickness
// SMALL_PICTURE_AREA - threshold area of the image to be consider a small picture
// NUM_RESOLUTIONS - number of resolutions to try
// MAX_DASH - maximum size of a dash in a dashed bond
// CC_BOND_LENGTH - average carbon-carbon bond length
// FRAME - border around structure in a segmented image
// SEPARATOR_ASPECT - aspect ratio for a perspective separator line
// SEPARATOR_AREA - area for a perspective separator line
// MAX_DIST - maximum distance in pixels between neighboring segments in image segmentation routines
// MAX_AREA_RATIO - maximum area ratio for connected compoments in image segmentation
// SINGLE_IMAGE_DIST - default distance between connected components in a single structure image
// THRESHOLD_LEVEL - threshold level for feature matrix for image segmentation
// TEXT_LINE_SIZE - maximum atomic label size in characters
// PARTS_IN_MARGIN - take only every other pixel on a connected component margin for speed
// BORDER_COUNT - threshold number of pixels on a box border to be considered a table
// MAX_SEGMENTS - maximum number of connected compoment segments
// MAX_FRAGMENTS - maximum number of fragments
// STRUCTURE_COUNT - threshold number of structures to compute limits on average bond length
// SPELLING_TXT - spelling file for OCR corrections
// SUPERATOM_TXT - superatom file for mapping labels to SMILES
#define PI 3.14159265358979323846
#define MAX_ATOMS 10000
#define MAX_FONT_HEIGHT 22
#define MAX_FONT_WIDTH 21
#define MIN_FONT_HEIGHT 5
#define BG_PICK_POINTS 1000
#define D_T_TOLERANCE 0.95
#define V_DISPLACEMENT 3
#define DIR_CHANGE 2
#define THRESHOLD_GLOBAL 0.4
#define THRESHOLD_LOW_RES 0.2
#define MAX_RATIO 0.2
#define MIN_ASPECT 0.1
#define MAX_ASPECT 10.
#define MIN_A_COUNT 5
#define MAX_A_COUNT 250
#define MIN_B_COUNT 5
#define MAX_B_COUNT 250
#define MIN_CHAR_POINTS 2
#define MAX_BOND_THICKNESS 10
#define SMALL_PICTURE_AREA 6000
#define NUM_RESOLUTIONS 5
#define MAX_DASH 40
#define CC_BOND_LENGTH 1.5120
#define FRAME 5
#define SEPARATOR_ASPECT 100
#define SEPARATOR_AREA 300
#define MAX_DIST 50
#define MAX_AREA_RATIO 50
#define SINGLE_IMAGE_DIST 1000
#define MAX_DISTANCE_BETWEEN_ARROWS 210
#define THRESHOLD_LEVEL 4
#define TEXT_LINE_SIZE 8
#define PARTS_IN_MARGIN 2
#define BORDER_COUNT 3000
#define MAX_SEGMENTS 10000
#define MAX_FRAGMENTS 10
#define STRUCTURE_COUNT 20
#define SPELLING_TXT "spelling.txt"
#define SUPERATOM_TXT "superatom.txt"
#define RECOGNIZED_CHARS "oOcCnNHFsSBuUgMeEXYZRPp23456789AmThDGQ"
#define ERROR_SPELLING_FILE_IS_MISSING -1
#define ERROR_SUPERATOM_FILE_IS_MISSING -2
#define ERROR_OUTPUT_FILE_OPEN_FAILED -3
// This error code may be returned, if ImageMagic was not able to find the .mgk files.
// Check that MAGICK_CONFIGURE_PATH points to the location of *.mgk configuration files (check here http://www.imagemagick.org/script/resources.php).
#define ERROR_UNKNOWN_IMAGE_TYPE -4
#define ERROR_ILLEGAL_ARGUMENT_COMBINATION -5
// This error code usually means:
// (a) You have no /usr/lib/openbabel/x.x.x/smilesformat.so library installed. Install the format libraries / check http://openbabel.org/docs/dev/Installation/install.html#environment-variables
// (b) The format libraries are installed, but do not correspond to /usr/lib/libopenbabel.so.y.y.y. Check they correspond to the same OpenBabel version.
// (c) You need to preload OpenBabel e.g. using LD_PRELOAD=/usr/lib/libopenbabel.so
#define ERROR_UNKNOWN_OPENBABEL_FORMAT -6
#endif
osra-2.1.3/src/osra_openbabel.cpp 0000664 0001750 0001750 00000102230 14115175251 015413 0 ustar igor igor /******************************************************************************
OSRA: Optical Structure Recognition Application
Created by Igor Filippov, 2007-2013 (igor.v.filippov@gmail.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include // std:ostringstream
#include // std::cerr
#include "osra_common.h" // trim()
#include "osra_structure.h"
#include "osra_openbabel.h"
#include "osra.h"
#include "osra_stl.h"
#include "mcdlutil.h"
using namespace OpenBabel;
#define HYDROGEN_ATOMIC_NUM 1
#define LITHIUM_ATOMIC_NUM 3
#define CARBON_ATOMIC_NUM 6
#define OXYGEN_ATOMIC_NUM 8
#define FLUORINE_ATOMIC_NUM 9
#define SILICONE_ATOMIC_NUM 14
#define CHLORINE_ATOMIC_NUM 17
#define ARGON_ATOMIC_NUM 18
#define BROMINE_ATOMIC_NUM 35
#define IODINE_ATOMIC_NUM 53
#define URANIUM_ATOMIC_NUM 92
// Look at this issue: https://sourceforge.net/tracker/?func=detail&aid=3425216&group_id=40728&atid=428740
#define AROMATIC_BOND_ORDER 5
int osra_openbabel_init()
{
OBConversion conv;
OBMol mol;
bool ok = conv.SetInFormat("SMI", false);
if (!ok)
return ERROR_UNKNOWN_OPENBABEL_FORMAT;
conv.ReadString(&mol, "[*]");
if (mol.NumAtoms() == 0)
return ERROR_UNKNOWN_OPENBABEL_FORMAT;
return 0;
}
// Function: create_atom()
//
// For the atom represented by its OCR'ed label create a new atom in the given molecule.
//
// Parameters:
// mol - the current molecule
// atom - atom to add to molecule (will be updated)
// scale - scale factor / coordinates multiplier
// superatom - superatom dictionary, that maps atom labels to corresponding SMILES
// verbose - print debug information
//
// Returns:
// true in case the given atom is superatom
//
bool create_atom(OBMol &mol, atom_t &atom, double scale,
const std::map &superatom, bool verbose)
{
if (atom.label.empty() || atom.label == " ")
{
atom.anum = CARBON_ATOMIC_NUM;
}
else
{
// Lookup in superatom dictionary:
std::map::const_iterator it = superatom.find(atom.label);
if (it != superatom.end())
{
// "superatom" case (e.g. "COOH")
const std::string &smiles_superatom = it->second;
OBConversion conv;
OBMol superatom_mol;
conv.SetInFormat("SMI");
conv.ReadString(&superatom_mol, smiles_superatom);
if (verbose)
std::cout << "Considering superatom " << atom.label << "->" << smiles_superatom <<
" vector: " << atom.x * scale << "x" << -atom.y * scale << '.' << std::endl;
// This is the index of first atom in superatom in molecule:
atom.n = mol.NumAtoms() + 1;
OBAtomIterator atom_iter;
// Transfer all atoms from "superatom" molecule to current molecule.
for (OBAtom *a = superatom_mol.BeginAtom(atom_iter); a; a = superatom_mol.NextAtom(atom_iter))
{
if (verbose)
std::cout << "Adding atom #" << mol.NumAtoms() + 1 << ", anum: " << a->GetAtomicNum() << std::endl;
OBAtom *new_atom = mol.NewAtom();
new_atom->SetAtomicNum(a->GetAtomicNum());
new_atom->SetFormalCharge(a->GetFormalCharge());
if (!atom.label.empty() && atom.label != " ")
{
// Unknown atom?
OBPairData *label = new OBPairData;
label->SetAttribute("UserLabel");
label->SetValue(atom.label);
label->SetOrigin(userInput); // set by user, not by Open Babel
new_atom->SetData(label);
}
if (atom.anum == 0)
{
AliasData* ad = new AliasData();
ad->SetAlias(atom.label);
ad->SetOrigin(external);
new_atom->SetData(ad);
}
}
// Correct first atom meta-info:
OBAtom *first_superatom = mol.GetAtom(atom.n);
first_superatom->SetVector(atom.x * scale, -atom.y * scale, 0);
atom.anum = first_superatom->GetAtomicNum();
int first_bond_index = mol.NumBonds();
OBBondIterator bond_iter;
// Transfer all bonds from "superatom" molecule to current molecule:
for (OBBond *b = superatom_mol.BeginBond(bond_iter); b; b = superatom_mol.NextBond(bond_iter))
{
if (verbose)
std::cout << "Adding bond #" << mol.NumBonds() << " " << b->GetBeginAtomIdx() + atom.n - 1 << "->" << b->GetEndAtomIdx() + atom.n - 1
<< ", order: " << b->GetBondOrder() << ", flags: " << b->GetFlags() << '.' << std::endl;
mol.AddBond(b->GetBeginAtomIdx() + atom.n - 1, b->GetEndAtomIdx() + atom.n - 1,
b->GetBondOrder(), b->GetFlags());
}
// If at least one bond was added, the "superatom" coordinates should be recalculated:
return first_bond_index != mol.NumBonds();
}
// If not found, lookup the atom number in periodic table of elements:
atom.anum = OBElements::GetAtomicNum(atom.label.c_str());
}
atom.n = mol.NumAtoms() + 1;
if (verbose)
std::cout << "Creating atom #" << atom.n << " \"" << atom.label << "\", anum: " << atom.anum << '.' << std::endl;
OBAtom *a = mol.NewAtom();
a->SetAtomicNum(atom.anum);
a->SetVector(atom.x * scale, -atom.y * scale, 0);
if (atom.charge != 0)
a->SetFormalCharge(atom.charge);
if (atom.anum != 0 && !atom.label.empty() && atom.label != " ")
{
// Unknown atom?
OBPairData *label = new OBPairData;
label->SetAttribute("UserLabel");
label->SetValue(atom.label);
label->SetOrigin(userInput); // set by user, not by Open Babel
a->SetData(label);
}
if (atom.anum == 0)
{
AliasData* ad = new AliasData();
ad->SetAlias(atom.label);
ad->SetOrigin(external);
a->SetData(ad);
}
return false;
}
// Function: confidence_function()
//
// Calculates confidence estimate based on molecular counts provided by
//
// Parameters:
// C_Count, N_Count, O_Count, F_Count, S_Count, Cl_Count, Br_Count - number of carbon, nitrogen, oxygen, fluorine, sulfur, chlorine, and bromine atoms
// R_Count - number of recognized Markush atomic labels, such as R1, R2....
// Xx_Count - number of unrecognized atomic labels from
// num_rings - number of rings
// num_aromatic - number of aromatic rings
// num_fragments - number of fragments
// Num_Rings - vector of counts for number of 3,4,5,6,7-member rings
//
// Returns:
// confidence estimate
double confidence_function(unsigned int* x, unsigned int n)
{
double c[] = {-0.11469143725730054, 0.15723547931889853, 0.19765680222250673, 0.249101590474403, 0.1897669087341134, 0.19588348907301223, 0.3354622208036507, 0.16779269801176255, -0.21232000222198893, 0.016958281784354032, -0.08672059360133752, -0.05105752296619957, -0.349912750824004, 0.18836317536530647, 0.22316782354758827, 0.27741998968081166, 0.25710999274481955, 0.27968899280120096, 0.12695166847876285, -0.10020778884718293, 0.05150631410596443, 0.22283571763712148, 0.23130179826714167, 0.1049054095759948, 0.05333970810460394, -0.12491056666737535};
double r = 0;
for (unsigned int i=0; iGetParent());
OBTetrahedralStereo *stereo;
if (facade.HasTetrahedralStereo(atom->GetId()))
stereo = facade.GetTetrahedralStereo(atom->GetId());
else
stereo = new OBTetrahedralStereo(atom->GetParent());
OBTetrahedralStereo::Config config = stereo->GetConfig();
config.center = atom->GetId();
config.specified = true;
config.winding = OBStereo::UnknownWinding;
//config.specified = false;
stereo->SetConfig(config);
if (!facade.HasTetrahedralStereo(atom->GetId()))
atom->GetParent()->SetData(stereo);
}
// Function: create_molecule()
//
// Converts vectors of atoms and bonds into a molecular object and calculates the molecule statistics.
// Note: this function changes the atoms!
//
// Parameters:
// atom - vector of atoms
// bond - vector of