File: configure.in

package info (click to toggle)
openbabel 2.0.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 15,652 kB
  • ctags: 15,998
  • sloc: cpp: 128,176; ansic: 86,170; sh: 8,920; perl: 1,847; python: 1,369; pascal: 793; makefile: 381; xml: 97
file content (179 lines) | stat: -rw-r--r-- 5,298 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
dnl Process this file with autoconf to produce a configure script.
AC_INIT([Open Babel], 2.0.2, openbabel-discuss@lists.sourceforge.net, openbabel)
AC_CONFIG_SRCDIR(src/zipstreamimpl.h)
AM_INIT_AUTOMAKE([no-define])
AM_MAINTAINER_MODE
AX_MAINTAINER_MODE_AUTO_SILENT
AM_CONFIG_HEADER(src/config.h)
AC_DEFINE_UNQUOTED([BABEL_VERSION], ["AC_PACKAGE_VERSION"], [The version of Open Babel])

AC_ARG_ENABLE(dynamic-modules,
	AS_HELP_STRING([--disable-dynamic-modules],
		       [disable building shared file format modules]),
		[dynamic_modules="$enable_dynamic_modules"],
		[dynamic_modules="yes"])

AC_CANONICAL_HOST

AC_DEFINE_DIR([BABEL_DATADIR], [datadir/AC_PACKAGE_TARNAME], [Where the data files are located])

AH_VERBATIM([OBAPI], 
[/* Used to export symbols for DLL / shared library builds */
#if defined(WIN32)
 #if defined(USING_OBDLL) // e.g. in src/main.cpp
  #define OBAPI __declspec(dllimport)
 #else
  #define OBAPI __declspec(dllexport)
 #endif
#else //Everything else (behaviour as original)
 #define OBAPI
#endif
])

AH_VERBATIM([EXTERN], 
[/* Used to export symbols for DLL / shared library builds */
#if defined(WIN32)
 #if defined(USING_OBDLL) // e.g. in src/main.cpp
  #define EXTERN __declspec(dllimport) extern
 #else
  #define EXTERN __declspec(dllexport) extern
 #endif
#else //Everything else (behaviour as original)
 #define EXTERN extern
#endif
])

AH_VERBATIM([OBCONV], 
[/* Used to export symbols for DLL / shared library builds */
#if defined(WIN32)
 #if defined(USING_OBDLL) // e.g. in src/main.cpp
  #define OBCONV __declspec(dllimport)
 #else
  #define OBCONV __declspec(dllexport)
 #endif
#else //Everything else (behaviour as original)
 #define OBCONV
#endif
])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_INSTALL
AC_PATH_PROG(DOXYGEN, doxygen)
AC_PATH_PROG(SWIG, swig)
AC_PATH_PROG(PERL, perl)
AC_PATH_PROG(PYTHON, python)

dnl Conditionally build docs, scripts, etc.

AM_CONDITIONAL(BUILD_DOCS, test x"$DOXYGEN" != "x")
if test x"$DOXYGEN" = "x"; then
AC_MSG_WARN(Cannot find doxygen to build documentation. 
	Have a look at http://www.doxygen.org/)
fi

dnl Build SWIG interfaces -- ideally use the latest SWIG available!!
dnl (this will happen also only if MAINTAINER_MODE is set
AM_CONDITIONAL(BUILD_SWIG, test x"$SWIG" != "x")

SCRIPTING="no"
if test x"$SWIG" != "x"; then
SCRIPTING="yes"
elif test x"$PYTHON" != "x"; then
SCRIPTING="yes"
elif test x"$PERL" != "x"; then
SCRIPTING="yes"
fi
AM_CONDITIONAL(BUILD_SCRIPTS, test "$SCRIPTING" = "yes")

dnl libtool
dnl You can set the shared library version in src/Makefile.am
dnl AC_DISABLE_SHARED
AC_LIBTOOL_DLOPEN
dnl We do support DLLs on Win32 systems
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

case $host in
     *-*-cygwin*)
	dynamic_modules="no"
	;;
     *-*-mingw*)
	dynamic_modules="no"
	;;
esac
AM_CONDITIONAL(BUILD_SHARED, test "$dynamic_modules" = "yes" -a "$enable_shared" = "yes")

oldmodule=$module
module=yes
eval std_shrext=\"$shrext_cmds\"
AC_DEFINE_UNQUOTED([MODULE_EXTENSION], ["$std_shrext"], [The file extension used for shared modules])
module=$oldmodule

AC_LANG_CPLUSPLUS
dnl Checks for libraries.
AC_CHECK_LIB(m, asin, , exit)
AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
AC_SUBST(LIBDL)

AM_PATH_XML2(2.6.5)
AM_CONDITIONAL(BUILD_XML, test x"$XML_LIBS" != "x")

AC_CHECK_LIB(inchi, GetINCHI, LIBINCHI="-linchi", LIBINCHI="")
AM_CONDITIONAL(BUILD_INCHI, test x"$LIBINCHI" == "x")

CHECK_ZLIB
AC_CHECK_LIB(z, inflateEnd)
AC_CHECK_HEADERS(zlib.h iconv.h)
AM_CONDITIONAL(BUILD_ZLIB, [test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"])

dnl Checks for header files.
AC_CHECK_HEADERS(sys/time.h unistd.h stdlib.h stdio.h conio.h string.h)
AC_CHECK_HEADERS(strstream.h iostream.h fstream.h math.h time.h)
AC_CHECK_HEADERS(ctype.h iostream fstream sstream strstream)
AC_HEADER_TIME

dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_TYPES(clock_t)
AC_C_CONST
AC_C_INLINE

dnl Checks for library functions.
AC_CHECK_FUNCS([rint sranddev])
AC_REPLACE_FUNCS([snprintf strncasecmp])

AH_VERBATIM([SNPRTF], 
[
#if !HAVE_SNPRINTF
extern "C" int snprintf( char *, size_t, const char *, /* args */ ...);
#endif
])

dnl Gotta figure out whether scandir needs a const or not for the 3rd arg.
AC_MSG_CHECKING([whether scandir needs a const cast])
AC_COMPILE_IFELSE([
#include <sys/types.h>
#include <dirent.h>
 extern int matchFiles (struct dirent *entry_p);
 struct dirent **entries_pp;
 int count = scandir ("./", &entries_pp, $dirent_t matchFiles, 0);
], 
[ AC_DEFINE(SCANDIR_T, , [set if scandir needs a const]) 
  AC_DEFINE(SCANDIR_CONST, , [set if scandir needs a const])
scandirconst_cast=no], 
[ AC_DEFINE(SCANDIR_T, [(int (*)(const dirent *))], [set if scandir needs a const]) 
  AC_DEFINE(SCANDIR_CONST, [const])
scandirconst_cast=yes])

AC_MSG_RESULT([$scandirconst_cast], [set if scandir needs a const])

AC_CONFIG_COMMANDS([src/babelconfig.h], 
                   [grep -v PACKAGE src/config.h >src/babelconfig.h])

AC_OUTPUT(Makefile data/Makefile src/Makefile src/math/Makefile \
		   src/formats/Makefile src/fingerprints/Makefile \
		   src/formats/xml/Makefile src/formats/inchi/Makefile \
		   test/Makefile test/cmltest/Makefile tools/Makefile \
		   doc/Makefile scripts/Makefile openbabel-2.0.pc)