forked from lepton-eda/lepton-eda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
440 lines (347 loc) · 15.1 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
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
dnl -*-Autoconf-*-
dnl Process this file with autoconf to generate configure.
dnl
dnl The AX_* macros are defined in files in the top-level m4
dnl directory.
#####################################################################
# Set up configuration system
#####################################################################
AC_INIT([Lepton EDA],
[1.9.18],
[https://github.com/lepton-eda/lepton-eda/issues],
[lepton-eda],
[https://github.com/lepton-eda/lepton-eda])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([liblepton/src/liblepton.c])
AC_CONFIG_AUX_DIR([build-tools])
AC_REQUIRE_AUX_FILE([test-driver.scm])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([parallel-tests color-tests foreign])
AM_SILENT_RULES([yes])
# Without this macro, some variables like M_PI won't be defined.
AC_GNU_SOURCE
#####################################################################
# Do version number magic
#####################################################################
AX_GIT_VERSION([20220529])
#####################################################################
# Windows/MinGW/Cygwin support
#####################################################################
AX_WINDOWS_FLAGS
#####################################################################
# Check for compiling & linking tools
#####################################################################
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Workaround for Automake 1.11
AC_LIBTOOL_WIN32_DLL
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
AX_GCC_FLAGS([-Wall -Werror=uninitialized -std=c99])
AC_PROG_MKDIR_P
AM_PROG_LEX
AX_PROG_AWK
AX_PROG_GROFF
AC_PATH_PROGS([M4], [gm4 m4], [m4])
#####################################################################
# Internationalisation
#####################################################################
AM_NLS
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18])
AX_DESKTOP_I18N
#####################################################################
# Check for libraries that use pkg-config
#####################################################################
PKG_PROG_PKG_CONFIG
AX_CHECK_GUILE([2.2.0])
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.38.0], ,
AC_MSG_ERROR([GLib 2.38.0 or later is required.]))
AC_DEFINE([G_DISABLE_DEPRECATED], [1], [Disable deprecated GLib features])
PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.38.0], ,
AC_MSG_ERROR([GIO 2.38.0 or later is required.]))
dnl GTK2 is used by default, though GTK3 can be choosen instead
dnl with the --with-gtk3 configure option.
AC_MSG_CHECKING([whether to use GTK3])
AC_ARG_WITH([gtk3],
AS_HELP_STRING([--with-gtk3], [Build with GTK3.]))
if test "X$with_gtk3" = "Xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_GTK3], [1],
[Define to 1 if GTK3 will be used for build.])
else
AC_MSG_RESULT([no])
fi
AS_CASE(["$with_gtk3"],
dnl Use GTK3.
[yes],
[PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.22.0],
[WITH_GTK3=1],
AC_MSG_ERROR([GTK+ 3.22.0 or later is required.]))],
dnl Default case: use GTK2.
[PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.24.0],
[WITH_GTK3=0],
AC_MSG_ERROR([GTK+ 2.24.0 or later is required.]))])
AM_CONDITIONAL([ENABLE_GTK3], [test "x$WITH_GTK3" = x1])
AS_CASE(["$with_gtk3"],
dnl Use GDK3.
[yes],
[PKG_CHECK_MODULES(GDK, [gdk-3.0 >= 3.22.0], ,
AC_MSG_ERROR([GDK 3.22.0 or later is required.]))],
dnl Default case: use GDK2.
[PKG_CHECK_MODULES(GDK, [gdk-2.0 >= 2.24.0], ,
AC_MSG_ERROR([GDK+ 2.24.0 or later is required.]))])
PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.21.0], ,
AC_MSG_ERROR([GDK_PIXBUF 2.21.0 or later is required.]))
dnl Enable compilation of Scheme files with guild.
AC_MSG_CHECKING([whether to use GUILD])
AC_ARG_ENABLE([guild],
AS_HELP_STRING([--enable-guild], [Enable guild compilation of Scheme files.]))
if test "X$enable_guild" = "Xyes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([ENABLE_GUILD], [test "X$enable_guild" = "Xyes"])
AX_CHECK_CAIRO
PKG_CHECK_MODULES(PANGOCAIRO, [pangocairo >= 0.26], ,
AC_MSG_ERROR([PANGOCAIRO 0.26 or later is required.]))
PKG_CHECK_MODULES(PANGO, [pango >= 1.23.0], ,
AC_MSG_ERROR([PANGO 1.23.0 or later is required.]))
dnl Use ldconfig to get shared library names in a case -dev files
dnl are not installed on the system.
AC_ARG_VAR(USE_LDCONFIG, [Use ldconfig to get shared library names])
dnl ImageMagick tools for tests.
AC_PATH_PROG(IM_COMPARE, compare)
AC_PATH_PROG(IM_CONVERT, convert)
AC_PATH_PROG(IM_IDENTIFY, identify)
dnl 'file' tool for tests.
AC_PATH_PROG(FILE, file)
#####################################################################
# Header files & particular functions
#####################################################################
AC_HEADER_SYS_WAIT
# FIXME these checks are obsolete, because every plausible platform
# provides what they check for.
AC_HEADER_STDC
# FIXME these checks may be pointless for one of three reasons: every
# even vaguely sane libc implementation provides them; we don't use
# any of their functions in favour of GLib alternatives; or we don't
# provide an alternative, so the build will fail anyway.
AC_CHECK_HEADERS([math.h stdlib.h string.h unistd.h])
# FIXME since we don't have a sensible alternative, if these headers
# are missing we should fail. Also need to remove HAVE_ERRNO_H tests
# in the C source code, since if we *don't* have it the build will
# fail anyway.
AC_CHECK_HEADERS([errno.h fcntl.h])
# FIXME On a system without locale.h, the user may have just disabled NLS
# to be able to build. But are there known systems with working NLS but
# without a locale.h? We do need to include locale.h on some systems
# to be able to build libleptongui/src/lepton-schematic.c
AC_CHECK_HEADERS([locale.h])
# Check for lrint in math library.
AC_CHECK_LIB([m], [lrint],
AC_DEFINE([HAVE_LRINT], 1,
[If your math library has lrint in it, define this]))
AC_CHECK_LIB([m], [atan2])
AC_CHECK_FUNCS([chown getlogin])
# Check if the getopt header is present
AC_CHECK_HEADERS([getopt.h])
# Check for getopt_long
# On FreeBSD the 'gnugetopt' library is needed.
AC_SEARCH_LIBS([getopt_long], [gnugetopt],
AC_DEFINE([HAVE_GETOPT_LONG], 1,
[Define to 1 if you have the `getopt_long' function.]))
# Check for misc features of awk
AX_AWK_FEATURES
#####################################################################
# Optional things
#####################################################################
# Assertions
AX_OPTION_ASSERT
# Viewing documentation
AX_OPTION_URI_VIEWER
# API documentation
AX_OPTION_DOXYGEN
# XDG desktop files
AX_OPTION_XDG_DATA
# XDG database updates
AX_OPTION_XDG_DB
# libstroke support
AX_OPTION_STROKE
# attrib
AX_OPTION_ATTRIB
# contributed software
AX_OPTION_CONTRIB
# doc
AX_OPTION_DOC
#####################################################################
# Tool-specific setup
#####################################################################
# Where should data files be installed/searched for?
AX_DATA_DIRS
# Where should PCB footprints be searched for?
AX_PCB_DIRS
# Set up liblepton with the correct ld version number
AX_LIBLEPTON([11:0:0])
# Set up libleptonattrib with the correct ld version number
AX_LIBLEPTONATTRIB([5:0:0])
# Set up libleptongui with the correct ld version number.
AX_LIBLEPTONGUI([5:0:0])
#####################################################################
# Generate output
#####################################################################
AC_CONFIG_FILES([tools/schematic/lepton-schematic:tools/script.in:tools/schematic/lepton-schematic.scm],
[chmod +x tools/schematic/lepton-schematic])
AC_CONFIG_FILES([tools/cli/scheme/lepton-cli:tools/script.in:tools/cli/scheme/lepton-cli.scm],
[chmod +x tools/cli/scheme/lepton-cli])
AC_CONFIG_FILES([tools/cli/scheme/lepton-config:tools/script.in:tools/cli/scheme/lepton-config.scm],
[chmod +x tools/cli/scheme/lepton-config])
AC_CONFIG_FILES([tools/cli/scheme/lepton-export:tools/script.in:tools/cli/scheme/lepton-export.scm],
[chmod +x tools/cli/scheme/lepton-export])
AC_CONFIG_FILES([tools/cli/scheme/lepton-shell:tools/script.in:tools/cli/scheme/lepton-shell.scm],
[chmod +x tools/cli/scheme/lepton-shell])
AC_CONFIG_FILES([tools/archive/lepton-archive:tools/script.in:tools/archive/lepton-archive.scm],
[chmod +x tools/archive/lepton-archive])
AC_CONFIG_FILES([tools/attrib/lepton-attrib:tools/script.in:tools/attrib/lepton-attrib.scm],
[chmod +x tools/attrib/lepton-attrib])
AC_CONFIG_FILES([tools/embed/lepton-embed:tools/script.in:tools/embed/lepton-embed.scm],
[chmod +x tools/embed/lepton-embed])
AC_CONFIG_FILES([tools/netlist/lepton-netlist:tools/script.in:tools/netlist/lepton-netlist.scm],
[chmod +x tools/netlist/lepton-netlist])
AC_CONFIG_FILES([tools/sch2pcb/lepton-sch2pcb:tools/script.in:tools/sch2pcb/lepton-sch2pcb.scm],
[chmod +x tools/sch2pcb/lepton-sch2pcb])
AC_CONFIG_FILES([tools/symcheck/lepton-symcheck:tools/script.in:tools/symcheck/lepton-symcheck.scm],
[chmod +x tools/symcheck/lepton-symcheck])
AC_CONFIG_FILES([tools/tragesym/lepton-tragesym:tools/script.in:tools/tragesym/lepton-tragesym.scm],
[chmod +x tools/tragesym/lepton-tragesym])
AC_CONFIG_FILES([tools/upcfg/lepton-upcfg:tools/script.in:tools/upcfg/lepton-upcfg.scm],
[chmod +x tools/upcfg/lepton-upcfg])
AC_CONFIG_FILES([tools/update/lepton-update:tools/script.in:tools/update/lepton-update.scm],
[chmod +x tools/update/lepton-update])
AC_CONFIG_FILES([Makefile
liblepton/Makefile
liblepton/liblepton.pc
liblepton/po/Makefile.in
liblepton/data/Makefile
liblepton/docs/Makefile
liblepton/docs/images/Makefile
liblepton/include/Makefile
liblepton/lib/Makefile
liblepton/scheme/Makefile
liblepton/src/Makefile
liblepton/tests/Makefile
tools/cli/Makefile
tools/cli/scheme/Makefile
tools/cli/docs/Makefile
tools/cli/po/Makefile.in
tools/cli/tests/Makefile
libleptongui/Makefile
libleptongui/libleptongui.pc
libleptongui/po/Makefile.in
libleptongui/docs/Makefile
libleptongui/include/Makefile
libleptongui/src/Makefile
libleptongui/examples/Makefile
libleptongui/lib/Makefile
libleptongui/data/Makefile
libleptongui/bitmap/Makefile
libleptongui/tests/Makefile
libleptongui/scheme/Makefile
tools/schematic/Makefile
libleptonattrib/libleptonattrib.pc
libleptonattrib/Makefile
libleptonattrib/po/Makefile.in
libleptonattrib/include/Makefile
libleptonattrib/src/Makefile
libleptonattrib/data/Makefile
libleptonattrib/docs/Makefile
tools/attrib/Makefile
tools/symcheck/tests/Makefile
tools/symcheck/docs/Makefile
tools/symcheck/Makefile
tools/netlist/Makefile
tools/netlist/scheme/Makefile
tools/netlist/examples/Makefile
tools/netlist/tests/Makefile
tools/netlist/tests/symcache/Makefile
tools/netlist/docs/Makefile
tools/netlist/docs/vams/Makefile
tools/netlist/examples/spice-noqsi/Makefile
tools/netlist/examples/vams/Makefile
tools/netlist/examples/vams/vhdl/Makefile
tools/netlist/examples/vams/vhdl/basic-vhdl/Makefile
tools/netlist/examples/vams/vhdl/new-vhdl/Makefile
tools/netlist/examples/switcap/Makefile
tools/netlist/examples/switcap/cache/Makefile
tools/netlist/examples/verilog/Makefile
tools/netlist/examples/verilog/T_FF_example/Makefile
tools/netlist/examples/verilog/T_FF_example/verilog_modules/Makefile
tools/netlist/examples/analog/Makefile
tools/netlist/examples/analog/varactor_osc/Makefile
tools/netlist/examples/analog/bandpass/Makefile
tools/netlist/examples/analog/voltage_doubler/Makefile
tools/Makefile
tools/symfix/Makefile
tools/symfix/docs/Makefile
tools/archive/docs/Makefile
tools/archive/tests/Makefile
tools/archive/Makefile
tools/embed/Makefile
tools/embed/docs/Makefile
tools/pcb_backannotate/Makefile
tools/pcb_backannotate/docs/Makefile
tools/refdes_renum/Makefile
tools/refdes_renum/docs/Makefile
tools/refdes_renum/tests/Makefile
tools/refdes_renum/tests/inputs/Makefile
tools/refdes_renum/tests/outputs/Makefile
tools/schdiff/Makefile
tools/schdiff/docs/Makefile
tools/upcfg/Makefile
tools/upcfg/docs/Makefile
tools/update/Makefile
tools/update/docs/Makefile
tools/update/tests/Makefile
tools/sch2pcb/Makefile
tools/sch2pcb/examples/Makefile
tools/sch2pcb/docs/Makefile
tools/sch2pcb/tests/Makefile
tools/tragesym/Makefile
tools/tragesym/examples/Makefile
tools/tragesym/docs/Makefile
symbols/Makefile
symbols/docs/Makefile
symbols/scheme/Makefile
symbols/sym/Makefile
symbols/sym-gnetman/Makefile
symbols/sym-verilog/Makefile
symbols/sym-vhdl/Makefile
docs/Makefile
docs/changelogs/Makefile
docs/manual/Makefile
docs/scheme-api/Makefile
docs/wiki/Makefile
docs/news/Makefile
docs/design/Makefile
examples/Makefile
examples/RF_Amp/Makefile
examples/TwoStageAmp/Makefile
examples/gTAG/Makefile
examples/lightning_detector/Makefile
contrib/Makefile
contrib/smash_megafile/Makefile
contrib/olib/Makefile
contrib/gmk_sym/Makefile
contrib/gmk_sym/examples/Makefile
contrib/sarlacc_schem/Makefile
contrib/scripts/Makefile
contrib/scripts/sw2asc
contrib/renum/Makefile
contrib/renum/src/Makefile
contrib/renum/docs/Makefile
])
AC_OUTPUT