Merge branch 'xorn'
[geda-gaf.git] / configure.ac
blob6d6f1e0e9500a2e6480b5c8d75a16072c5888a66
1 dnl                                                      -*-Autoconf-*-
2 dnl Process this file with autoconf to generate configure.
3 dnl
4 dnl The AX_* macros are defined in files in the top-level m4
5 dnl directory.
7 #####################################################################
8 # Set up configuration system
9 #####################################################################
11 AC_INIT([gEDA/gaf], [1.9.2], [https://bugs.launchpad.net/geda], [geda-gaf])
12 AC_PREREQ([2.60])
14 AC_CONFIG_SRCDIR([libgeda/src/libgeda.c])
15 AC_CONFIG_AUX_DIR([build-tools])
16 AC_CONFIG_MACRO_DIR([m4])
17 AC_CONFIG_HEADER([config.h])
19 AM_INIT_AUTOMAKE([parallel-tests color-tests])
20 AM_SILENT_RULES
22 AC_GNU_SOURCE # FIXME for some reason this is needed?
24 #####################################################################
25 # Do version number magic
26 #####################################################################
28 AX_GIT_VERSION([20150930])
30 # This is used for keeping the ChangeLog files up-to-date
31 AC_SUBST([CHANGELOG_BASE], [1.0-20070526])
33 #####################################################################
34 # Windows/MinGW/Cygwin support
35 #####################################################################
37 AX_WINDOWS_FLAGS
39 #####################################################################
40 # Check for compiling & linking tools
41 #####################################################################
43 AC_PROG_CC
44 AC_PROG_CPP
45 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Workaround for Automake 1.11
47 AC_LIBTOOL_WIN32_DLL
48 AC_DISABLE_STATIC
49 AC_PROG_LIBTOOL
51 AM_PROG_CC_C_O
52 AX_GCC_FLAGS([-Wall -Werror=maybe-uninitialized -std=gnu99])
54 AC_PROG_MKDIR_P
55 AM_PROG_LEX
56 AX_PROG_AWK
57 AX_PROG_GROFF
58 AC_PATH_PROGS([M4], [gm4 m4], [m4])
60 #####################################################################
61 # Internationalisation
62 #####################################################################
64 AM_NLS
65 AM_GNU_GETTEXT([external])
66 AM_GNU_GETTEXT_VERSION([0.18])
67 AX_DESKTOP_I18N
69 #####################################################################
70 # Check for libraries that use pkg-config
71 #####################################################################
73 PKG_PROG_PKG_CONFIG
75 AX_CHECK_GUILE([2.0.0])
77 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.20.0], ,
78   AC_MSG_ERROR([GLib 2.20.0 or later is required.]))
80 PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.20.0], ,
81   AC_MSG_ERROR([GIO 2.20.0 or later is required.]))
83 PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.18.0], ,
84   AC_MSG_ERROR([GTK+ 2.18.0 or later is required.]))
86 PKG_CHECK_MODULES(GDK, [gdk-2.0 >= 2.18.0], ,
87   AC_MSG_ERROR([GDK 2.18.0 or later is required.]))
89 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.18.0], ,
90   AC_MSG_ERROR([GDK_PIXBUF 2.18.0 or later is required.]))
92 AX_CHECK_CAIRO
94 PKG_CHECK_MODULES(PANGOCAIRO, [pangocairo >= 0.26], ,
95   AC_MSG_ERROR([PANGOCAIRO 0.26 or later is required.]))
97 PKG_CHECK_MODULES(PANGO, [pango >= 1.23.0], ,
98   AC_MSG_ERROR([PANGO 1.23.0 or later is required.]))
100 #####################################################################
101 # Header files & particular functions
102 #####################################################################
104 AC_HEADER_SYS_WAIT
106 # FIXME these checks are obsolete, because every plausible platform
107 # provides what they check for.
108 AC_HEADER_STDC
110 # FIXME these checks may be pointless for one of three reasons: every
111 # even vaguely sane libc implementation provides them; we don't use
112 # any of their functions in favour of GLib alternatives; or we don't
113 # provide an alternative, so the build will fail anyway.
114 AC_CHECK_HEADERS([math.h stdlib.h string.h unistd.h])
116 # FIXME since we don't have a sensible alternative, if these headers
117 # are missing we should fail. Also need to remove HAVE_ERRNO_H tests
118 # in the C source code, since if we *don't* have it the build will
119 # fail anyway.
120 AC_CHECK_HEADERS([errno.h fcntl.h])
122 # FIXME On a system without locale.h, the user may have just disabled NLS
123 # to be able to build.  But are there known systems with working NLS but
124 # without a locale.h?  We do need to include locale.h on some systems
125 # to be able to build gschem/src/gschem.c
126 AC_CHECK_HEADERS([locale.h])
128 # Check for lrint in math library.
129 AC_CHECK_LIB([m], [lrint],
130              AC_DEFINE([HAVE_LRINT], 1,
131                        [If your math library has lrint in it, define this]))
133 AC_CHECK_LIB([m], [atan2])
135 AC_CHECK_FUNCS([chown getlogin])
137 # Check if the getopt header is present
138 AC_CHECK_HEADERS([getopt.h])
139 # Check for getopt_long
140 # On FreeBSD the 'gnugetopt' library is needed.
141 AC_SEARCH_LIBS([getopt_long], [gnugetopt],
142                AC_DEFINE([HAVE_GETOPT_LONG], 1,
143                          [Define to 1 if you have the `getopt_long' function.]))
145 # Check for misc features of awk
146 AX_AWK_FEATURES
148 #####################################################################
149 # Optional things
150 #####################################################################
152 # Assertions
153 AX_OPTION_ASSERT
154 # Deprecated features
155 AX_OPTION_DEPRECATED
156 # Viewing documentation
157 AX_OPTION_URI_VIEWER
158 # API documentation
159 AX_OPTION_DOXYGEN
160 # XDG desktop files
161 AX_OPTION_XDG_DATA
162 # KDE 3 desktop files
163 AX_OPTION_KDE3_DATA
164 # XDG database updates
165 AX_OPTION_XDG_DB
166 # libstroke support
167 AX_OPTION_STROKE
168 # gattrib
169 AX_OPTION_GATTRIB
171 #####################################################################
172 # Tool-specific setup
173 #####################################################################
175 # Where should data files be installed/searched for?
176 AX_DATA_DIRS
177 # Where should PCB footprints be searched for?
178 AX_PCB_DIRS
179 # Set up libgeda with the correct ld version number
180 AX_LIBGEDA([45:0:0])
181 # Set up libgedacairo with the correct ld version number
182 AX_LIBGEDACAIRO([1:1:0])
184 #####################################################################
185 # Recurse into Xorn configuration
186 #####################################################################
188 AC_ARG_ENABLE([xorn],
189               [AS_HELP_STRING([--disable-xorn],
190                               [don't build and install Xorn])],
191               [], [export enable_xorn; enable_xorn=yes])
193 case "${enable_xorn}" in
194   yes) AC_DEFINE([HAVE_XORN], 1, [Define to 1 if using Xorn.]) ;;
195   no) ;;
196   *) AC_MSG_ERROR([bad value ${enable_xorn} for --enable-xorn]) ;;
197 esac
199 AM_CONDITIONAL([XORN], [test x$enable_xorn = xyes])
201 export GEDADATADIR
202 export GEDARCDIR
204 AC_CONFIG_SUBDIRS([xorn])
206 #####################################################################
207 # Generate output
208 #####################################################################
210 AC_CONFIG_FILES([Makefile
212                  libgeda/Makefile
213                  libgeda/libgeda.pc
214                  libgeda/po/domain.mak
215                  libgeda/po/Makefile.in
216                  libgeda/data/Makefile
217                  libgeda/docs/Makefile
218                  libgeda/docs/images/Makefile
219                  libgeda/include/Makefile
220                  libgeda/lib/Makefile
221                  libgeda/scheme/Makefile
222                  libgeda/src/Makefile
223                  libgeda/tests/Makefile
225                  libgedacairo/Makefile
226                  libgedacairo/libgedacairo.pc
228                  gaf/Makefile
229                  gaf/po/Makefile.in
231                  gschem/Makefile
232                  gschem/po/Makefile.in
233                  gschem/docs/Makefile
234                  gschem/include/Makefile
235                  gschem/scripts/Makefile
236                  gschem/src/Makefile
237                  gschem/examples/Makefile
238                  gschem/lib/Makefile
239                  gschem/data/Makefile
240                  gschem/bitmap/Makefile
241                  gschem/tests/Makefile
242                  gschem/scheme/Makefile
244                  gattrib/Makefile
245                  gattrib/po/Makefile.in
246                  gattrib/design/Makefile
247                  gattrib/docs/Makefile
248                  gattrib/include/Makefile
249                  gattrib/lib/Makefile
250                  gattrib/lib/system-gattribrc
251                  gattrib/src/Makefile
252                  gattrib/data/Makefile
254                  gsymcheck/docs/Makefile
255                  gsymcheck/include/Makefile
256                  gsymcheck/lib/Makefile
257                  gsymcheck/lib/system-gsymcheckrc
258                  gsymcheck/po/Makefile.in
259                  gsymcheck/src/Makefile
260                  gsymcheck/tests/Makefile
261                  gsymcheck/Makefile
263                  gnetlist/Makefile
264                  gnetlist/po/Makefile.in
265                  gnetlist/src/Makefile
266                  gnetlist/include/Makefile
267                  gnetlist/scheme/Makefile
268                  gnetlist/examples/Makefile
269                  gnetlist/tests/Makefile
270                  gnetlist/docs/Makefile
271                  gnetlist/docs/vams/Makefile
272                  gnetlist/examples/vams/Makefile
273                  gnetlist/examples/vams/vhdl/Makefile
274                  gnetlist/examples/vams/vhdl/basic-vhdl/Makefile
275                  gnetlist/examples/vams/vhdl/new-vhdl/Makefile
276                  gnetlist/examples/switcap/Makefile
277                  gnetlist/lib/Makefile
278                  gnetlist/utils/Makefile
279                  gnetlist/scripts/Makefile
280                  gnetlist/scripts/annotate.sh
281                  gnetlist/scripts/bom_xref.sh
282                  gnetlist/scripts/bompp.sh
283                  gnetlist/lib/system-gnetlistrc
285                  utils/Makefile
286                  utils/docs/Makefile
287                  utils/examples/Makefile
288                  utils/examples/gmk_sym/Makefile
289                  utils/examples/gsch2pcb/Makefile
290                  utils/examples/tragesym/Makefile
291                  utils/gschlas/Makefile
292                  utils/gxyrs/Makefile
293                  utils/include/Makefile
294                  utils/lib/Makefile
295                  utils/lib/system-gschlasrc
296                  utils/scripts/Makefile
297                  utils/src/Makefile
298                  utils/tests/Makefile
299                  utils/tests/gxyrs/Makefile
300                  utils/tests/gxyrs/inputs/Makefile
301                  utils/tests/gxyrs/outputs/Makefile
302                  utils/tests/refdes_renum/Makefile
303                  utils/tests/refdes_renum/inputs/Makefile
304                  utils/tests/refdes_renum/outputs/Makefile
306                  symbols/Makefile
307                  symbols/documentation/Makefile
309                  docs/Makefile
310                  docs/scheme-api/Makefile
311                  docs/toplevel/Makefile
312                  docs/toplevel/gedadocs.html
313                  docs/wiki/Makefile
315                  examples/Makefile
316                  examples/RF_Amp/Makefile
317                  examples/RF_Amp/model/Makefile
318                  examples/RF_Amp/sym/Makefile
319                  examples/TwoStageAmp/Makefile
320                  examples/gTAG/Makefile
321                  examples/lightning_detector/Makefile
323                  contrib/Makefile
324                  contrib/smash_megafile/Makefile
325                  contrib/olib/Makefile
326                  contrib/gmk_sym/Makefile
327                  contrib/sarlacc_schem/Makefile
328                  contrib/scripts/Makefile
329                  contrib/scripts/sw2asc
331 AC_OUTPUT
333 if test "x${enable_xorn}" != "xyes"
334 then    cat <<EOF >&2
336     ########################################################################
337     ##                                                                    ##
338     ##    You chose to disable Xorn during configuration.  This means     ##
339     ##    core functionality will not be available.  Most notably, you    ##
340     ##    won't be able to use the new gnetlist frontend.                 ##
341     ##                                                                    ##
342     ########################################################################