-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
113 lines (88 loc) · 2.96 KB
/
configure.ac
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
dnl configure.ac
dnl Copyright (C) 2010 Free Software Foundation, Inc.
dnl
dnl This program is free software, licensed under the terms of the GNU
dnl General Public License as published by the Free Software Foundation,
dnl either version 3 of the License, or (at your option) any later version.
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.61])
AC_INIT([LibreDWG],[0.4-dev],[[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.12.2 gnu no-define serial-tests])
dnl libretoolize asked me for it
AC_CONFIG_MACRO_DIR([m4])
dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
AM_CONFIG_HEADER([src/config.h])
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AC_CANONICAL_HOST
dnl Checks for programs.
PKG_PROG_PKG_CONFIG
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LIBTOOL
LT_INIT
dnl Checks for libraries.
AC_CHECK_LIB([ps],[PS_open_file],
libredwg_have_libps=yes,
libredwg_have_libps=no)
PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],,
[AC_MSG_ERROR([Install libxml-2.0 first])])
XML2_CFLAGS=`$PKG_CONFIG libxml-2.0 --cflags`
AC_SUBST([XML2_CFLAGS])
XML2_LIBS=`$PKG_CONFIG libxml-2.0 --libs`
AC_SUBST([XML2_LIBS])
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
AC_CHECK_HEADER(dejagnu.h, , [AC_MSG_ERROR(
[Couldn't find dejagnu.h. Install Dejagnu first] )])
# Don't bother testing for libps headers if libps is not available.
if test yes = "$libredwg_have_libps" ; then
AC_CHECK_HEADERS([libps/pslib.h])
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STAT
dnl Feature: --enable-trace
AC_ARG_ENABLE([trace],[AS_HELP_STRING([--enable-trace],[
Enable runtime tracing (default: no). When enabled, the environment
variable LIBREDWG_TRACE is consulted on the first decode/encode attempt.
Its value is an integer: 0 (no output) through 9 (full verbosity).])],[
AC_DEFINE([USE_TRACING],1,[Define to 1 to enable runtime tracing support.])
])
dnl Feature: --enable-write
AC_ARG_ENABLE([write],[AS_HELP_STRING([--enable-write],[
Enable write support (default: no).])],[
AC_DEFINE([USE_WRITE],1,[Define to 1 to enable write support.])
])
dnl Test support.
AM_CONDITIONAL([HAVE_LIBPS],[test yes = "$libredwg_have_libps" &&
test yes = "$ac_cv_header_libps_pslib_h"])
dnl for SWIG - should be optional
AM_PATH_PYTHON([2.3])
AX_PKG_SWIG([1.3.17], [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
dnl AX_SWIG_ENABLE_CXX
dnl SWIG_MULTI_MODULE_SUPPORT
SWIG_PYTHON
dnl Write it out!
AC_CONFIG_FILES([
Makefile
src/Makefile
doc/Makefile
examples/Makefile
bindings/Makefile
bindings/python/Makefile
testsuite/Makefile
testsuite/testcases/Makefile
testsuite/xmlsuite/Makefile
unit-testing/Makefile
])
AC_OUTPUT
dnl configure.ac ends here