File: configure.in

package info (click to toggle)
libg3d 0.0.8-26
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,700 kB
  • sloc: ansic: 27,295; sh: 9,288; xml: 4,123; makefile: 865; cpp: 13
file content (223 lines) | stat: -rw-r--r-- 6,078 bytes parent folder | download | duplicates (6)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223

AC_INIT(configure.in)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])

# versioning stuff
m4_define([g3d_major_version], [0])
m4_define([g3d_minor_version], [0])
m4_define([g3d_micro_version], [8])
m4_define([g3d_interface_age], [8])
m4_define([g3d_version],
	[g3d_major_version.g3d_minor_version.g3d_micro_version])
m4_define([g3d_binary_age],
	[m4_eval(100 * g3d_minor_version + g3d_micro_version)])
VERSION=g3d_version

m4_define([lt_current],
	[m4_eval(100 * g3d_minor_version + g3d_micro_version - g3d_interface_age)])
m4_define([lt_revision], [g3d_interface_age])
m4_define([lt_age], [m4_eval(g3d_binary_age - g3d_interface_age)])
LTVERSION="lt_current:lt_revision:lt_age"

PACKAGE=libg3d

AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AC_SUBST(VERSION)
AC_SUBST(LTVERSION)

AC_CONFIG_HEADERS(include/g3d/config.h)

AC_PROG_CC
AC_PROG_CXX
AM_PROG_LEX
AC_HEADER_STDC

AC_DISABLE_STATIC

AM_IS_WIN32
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = yes)

AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

# gtk-doc
GTK_DOC_CHECK

# glib
AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([glib >= 2.0 is needed]), gmodule gobject)

# gdk-pixbuf
AM_PATH_GTK_2_0(2.0.0, have_gtk2=true)
if test "x$have_gtk2" = "xtrue" ; then
GDKPIXBUF_CFLAGS=$GTK_CFLAGS
GDKPIXBUF_LIBS=$GTK_LIBS
AC_SUBST(GDKPIXBUF_CFLAGS)
AC_SUBST(GDKPIXBUF_LIBS)
fi
AM_CONDITIONAL([HAVE_GDKPIXBUF], test "x$have_gtk2" = "xtrue")

# libxml2
AM_PATH_XML2(2.0.0, have_libxml2=true)
if test "x$have_libxml2" = "xtrue" ; then
LIBXML2_CFLAGS=$XML_CPPFLAGS
LIBXML2_LIBS=$XML_LIBS
AC_SUBST(LIBXML2_CFLAGS)
AC_SUBST(LIBXML2_LIBS)
fi
AM_CONDITIONAL([HAVE_LIBXML2], test "x$have_libxml2" = "xtrue")

# libgsf
PKG_CHECK_MODULES(LIBGSF, libgsf-1 >= 1.0.0,
	[have_libgsf=true], [have_libgsf=false])
if test "x$have_libgsf" = "xtrue" ; then
AC_DEFINE([HAVE_LIBGSF], 1, [have GSF library])
fi
AM_CONDITIONAL([HAVE_LIBGSF], test "x$have_libgsf" = "xtrue")

# libmagic
AC_ARG_ENABLE(libmagic,
	[[  --disable-libmagic      disable file type detection using libmagic]],
	[if test "$enableval" = "no" ; then disable_libmagic=true ; fi])
if test "x$disable_libmagic" != "xtrue" ; then
AC_CHECK_HEADER([magic.h], have_magic_h=true)
AC_CHECK_LIB([magic], [magic_open], have_magic_open=true)
if test "x$have_magic_h" = "xtrue" && test "x$have_magic_open" = "xtrue"; then
have_libmagic=true
AC_DEFINE([USE_LIBMAGIC], 1, [use libmagic for file type detection])
AC_DEFINE_DIR([MAGIC_FILENAME], libdir/$PACKAGE/libg3d.magic, [magic file])
MAGIC_LIBS=-lmagic
fi
fi
AC_SUBST(MAGIC_LIBS)
#AM_CONDITIONAL([USE_LIBMAGIC], test "x$have_libmagic" = "xtrue")

# libm
AC_CHECK_LIB(m, sqrt,, [AC_MSG_ERROR([requires math library])])
MATH_LIBS=-lm
AC_SUBST(MATH_LIBS)

# zlib
Z_DIR= Z_LIBS= Z_CFLAGS=
AC_ARG_WITH(zlib,
	[[  --with-zlib=DIR       use libz in DIR]],
	[case $withval in
	 yes|no) ;;
	 *) Z_DIR=$withval
	 	CPPFLAGS="${CPPFLAGS} -I$withval/include"
		LDFLAGS="${LDFLAGS} -L$withval/lib"
		;;
	 esac])
if test "x$with_zlib" != xno; then
	with_zlib=no
	AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzread, [with_zlib=yes])])
fi
if test "x$Z_DIR" != "x"; then
	Z_CFLAGS="-I$Z_DIR/include"
	Z_LIBS="-L$Z_DIR/lib -lz"
else
	Z_LIBS="-lz"
fi
AC_SUBST(Z_CFLAGS)
AC_SUBST(Z_LIBS)
if test "$with_zlib" = "yes"; then
	AC_DEFINE([HAVE_ZLIB], 1, [have zlib])
fi
AM_CONDITIONAL([HAVE_ZLIB], test "$with_zlib" = "yes")

# Debug level (verbosity & optimization)
AC_MSG_CHECKING([for debug level])
AC_ARG_ENABLE(debug, 
	[[  --enable-debug[=LVL]    enable debug level LVL or 1 (default is 0)]],
	[if test "$enableval" = "yes" ; then DEBUG=1; else DEBUG=$enableval; fi],
	DEBUG=0)
AC_MSG_RESULT($DEBUG)
AC_SUBST(DEBUG)

AC_ARG_ENABLE(experimental,
	[[  --enable-experimental   enable experimental and unfinished plugins]],
	[if test "x$enableval" = "xyes" ; then experimental=1
		else experimental=0; fi],
	experimental=0)
AM_CONDITIONAL([EXPERIMENTAL], test "x$experimental" = "x1")

AC_ARG_ENABLE(cxxtest,
	[[  --enable-cxxtest        enable C++ test]],
	[if test "x$enableval" = "xyes" ; then cxxtest=1 else cxxtest=0; fi],
	cxxtest=0)
AM_CONDITIONAL([HAVE_CXX], test "x$cxxtest" = "x1")

AC_ARG_ENABLE(profile,
	[[  --enable-profile        enable gprof profiling]],
	[if test "x$enableval" = "xyes" ; then profile="-pg"
		else profile=""; fi],
	profile="")

if test "$DEBUG" = "0"; then
	DBG_CFLAGS="-O2 $profile"
else
	DBG_CFLAGS="-g $profile"
fi
AC_SUBST(DBG_CFLAGS)

# plugin directories
AC_DEFINE_DIR(PLUGIN_DIR, libdir/$PACKAGE/plugins, [Plugin directory])

PLUGINS_LDFLAGS="-avoid-version -export-dynamic"
AC_SUBST(PLUGINS_LDFLAGS)

AC_OUTPUT(
	Makefile
	doc/Makefile
	doc/api/Makefile
	doc/support_matrix/Makefile
	include/Makefile
	include/g3d/Makefile
	m4/Makefile
	plugins/Makefile
	plugins/image/Makefile
	plugins/import/Makefile
	plugins/import/imp_3dm/Makefile
	plugins/import/imp_3dmf/Makefile
	plugins/import/imp_3ds/Makefile
	plugins/import/imp_ac3d/Makefile
	plugins/import/imp_acf/Makefile
	plugins/import/imp_ar/Makefile
	plugins/import/imp_ase/Makefile
	plugins/import/imp_blend/Makefile
	plugins/import/imp_c4d/Makefile
	plugins/import/imp_cob/Makefile
	plugins/import/imp_dae/Makefile
	plugins/import/imp_dpm/Makefile
	plugins/import/imp_dxf/Makefile
	plugins/import/imp_flt/Makefile
	plugins/import/imp_glb/Makefile
	plugins/import/imp_heightfield/Makefile
	plugins/import/imp_iob/Makefile
	plugins/import/imp_joe/Makefile
	plugins/import/imp_kmz/Makefile
	plugins/import/imp_ldraw/Makefile
	plugins/import/imp_leocad/Makefile
	plugins/import/imp_lwo/Makefile
	plugins/import/imp_max/Makefile
	plugins/import/imp_maya/Makefile
	plugins/import/imp_md2/Makefile
	plugins/import/imp_md3/Makefile
	plugins/import/imp_nff/Makefile
	plugins/import/imp_obj/Makefile
	plugins/import/imp_osm/Makefile
	plugins/import/imp_q3o/Makefile
	plugins/import/imp_r4/Makefile
	plugins/import/imp_rbh/Makefile
	plugins/import/imp_skp/Makefile
	plugins/import/imp_stl/Makefile
	plugins/import/imp_ta/Makefile
	plugins/import/imp_test/Makefile
	plugins/import/imp_vrml/Makefile
	plugins/import/imp_vrml2/Makefile
	src/Makefile
	programs/Makefile
	tests/Makefile
	libg3d.pc
)