ntdisp 

ntdisp Git Source Tree

Root/configure.ac

1m4_define([ntdisp_version],[0.5.1])
2m4_define([ntdisp_lt_version],[1:0:0])dnl XXX: update when required
3
4# GTK+3 yet requires GLib >= 2.28, so no need to explicitely depends
5# on GLib >= 2.26 for using GSettings from the GTK+3 front-end
6m4_define([gtkdoc_prereq],[1.9])dnl Historical value
7m4_define([glib_prereq],[2.18.0])dnl Required by g_set_error_literal
8m4_define([gobject_prereq],[2.10.1])dnl Version 2.10.0 is broken
9m4_define([gtk3_prereq],[3.0.0])
10
11
12dnl Historical value. Will be raised to 2.62
13dnl when GObject introspection will be added:
14dnl http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration
15AC_PREREQ(2.59)
16
17AC_INIT([ntdisp],ntdisp_version,[http://dev.entidi.com/p/ntdisp/],[ntdisp],[http://ntdisp.entidi.com/])
18PACKAGE_DESCRIPTION="NtD In System Programming"
19AC_SUBST([PACKAGE_DESCRIPTION])
20
21AC_CONFIG_SRCDIR([configure.ac])
22AC_CONFIG_HEADERS([src/config.h])
23AC_CONFIG_AUX_DIR([build])
24AC_CONFIG_MACRO_DIR([build])
25dnl automake 1.10.1 is required for silent rules
26AM_INIT_AUTOMAKE([1.10.1 gnits no-dist-gzip dist-bzip2 -Wall -Wno-portability])
27m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
28
29
30# Libtool initialization
31
32AC_MSG_CHECKING([which libtool initialization strategy to adopt])
33AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
34m4_ifset([LT_INIT],
35 [LT_INIT([disable-static win32-dll])],
36 [AC_DISABLE_STATIC
37 AC_LIBTOOL_WIN32_DLL
38 AC_PROG_LIBTOOL])
39AC_SUBST([NTDISP_LT_VERSION],ntdisp_lt_version)
40
41
42# Checks for programs
43
44AC_PROG_CC
45AC_PROG_SED
46PKG_PROG_PKG_CONFIG
47AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[/usr/bin/glib-mkenums])
48AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[/usr/bin/glib-genmarshal])
49AC_PATH_PROG([MAKENSIS],[makensis],[/usr/bin/makensis])
50
51
52# Checks for header files
53
54AC_CHECK_HEADERS([string.h])
55AC_CHECK_HEADERS([fcntl.h])
56AC_CHECK_HEADERS([termios.h])
57
58
59# Checking typedefs, structures and compiler characteristics
60
61AC_LANG(C)
62AC_C_CONST
63
64
65# Custom options
66
67AC_ARG_WITH(api,
68 [AS_HELP_STRING([--with-api@<:@=posix/win32@:>@],
69 [Use POSIX or win32 API for serial communications @<:@default=posix@:>@])],
70 [],[with_api=posix])
71AS_CASE(["${with_api}"],
72 [posix], [enable_win32=no],
73 [win32], [enable_win32=yes],
74 [AC_MSG_ERROR([Invalid option passed to --with-api])])
75AM_CONDITIONAL([ENABLE_WIN32],test "x$enable_win32" = "xyes")
76
77
78# Front-ends
79
80frontends=
81
82# The "library" front-end is always included, otherwise there will be
83# no reason to build the ntdisp project
84frontends=" library"
85
86AC_ARG_ENABLE([cli],
87 AS_HELP_STRING([--disable-cli], [Do not build the command-line interface]),
88 [],[enable_cli="yes"])
89AM_CONDITIONAL([ENABLE_CLI],test "x$enable_cli" = "xyes")
90AS_IF([test "x${enable_cli}" = "xyes"],[frontends="$frontends CLI"])
91
92AC_ARG_ENABLE([gtk3],
93 AS_HELP_STRING([--disable-gtk3], [Do not build GTK3 front-end]),
94 [],[enable_gtk3="yes"])
95AM_CONDITIONAL([ENABLE_GTK3],test "x$enable_gtk3" = "xyes")
96AS_IF([test "x${enable_gtk3}" = "xyes"],[frontends="$frontends GTK+3"])
97
98
99# Back-ends
100
101backends=
102
103AC_ARG_ENABLE([lpc],
104 AS_HELP_STRING([--disable-lpc], [Do not include the LPC In-System Programming (NXP Semiconductors)]),
105 [],[enable_lpc="yes"])
106AM_CONDITIONAL([ENABLE_LPC],test "x$enable_lpc" = "xyes")
107AS_IF([test "x${enable_lpc}" = "xyes"],[backends="$backends lpc"])
108
109AC_ARG_ENABLE([stm],
110 AS_HELP_STRING([--disable-stm], [Do not include the STM32 In-Circuit Programming (ST Microelectronics)]),
111 [],[enable_stm="yes"])
112AM_CONDITIONAL([ENABLE_STM],test "x$enable_stm" = "xyes")
113AS_IF([test "x${enable_stm}" = "xyes"],[backends="$backends stm"])
114
115AC_ARG_ENABLE([stellaris],
116 AS_HELP_STRING([--enable-stellaris], [Include the Stellaris serial flash loader (Texas Instruments)]),
117 [],[enable_stellaris="no"])
118AM_CONDITIONAL([ENABLE_STELLARIS],test "x$enable_stellaris" = "xyes")
119AS_IF([test "x${enable_stellaris}" = "xyes"],[backends="$backends stellaris"])
120
121
122# Checks for external dependencies
123
124GTK_DOC_CHECK(gtkdoc_prereq)
125
126if test "x$enable_gtk_doc" == "xyes"; then
127 gtk_doc_report="yes (gtk-doc $($PKG_CONFIG --modversion gtk-doc) found)"
128else
129 gtk_doc_report="no"
130fi
131
132PKG_CHECK_MODULES([GLIB2],
133 [glib-2.0 >= ]glib_prereq
134 [gobject-2.0 >= ]gobject_prereq
135 [gthread-2.0])
136
137if test "x$enable_gtk3" != "xno" ; then
138 PKG_CHECK_MODULES([GTK3],
139 [gtk+-3.0 >= ]gtk3_prereq,
140 [gtk3_found="yes"],
141 [gtk3_found="no"])
142 if test "x$enable_gtk3" == "xyes" -a "x$gtk3_found" == "xno" ; then
143 AC_MSG_ERROR([GTK+3 support requested but GTK+3 development files not found])
144 elif test "x$enable_gtk3" == "xcheck" ; then
145 enable_gtk3="$gtk3_found"
146 fi
147 if test "x$enable_gtk3" == "xyes"; then
148 gtk3_report="yes (GTK+ $($PKG_CONFIG --modversion gtk+-3.0) found)"
149 GLIB_GSETTINGS
150 AC_DEFINE_UNQUOTED([NTDISP_SCHEMA],["com.entidi.NtdIsp"],
151 [Define to id of the schema to use for GSettings.])
152 else
153 gtk3_report="no"
154 fi
155fi
156
157
158# Final step
159
160dnl Define USRDIR for the NSis installer script:
161dnl all the DLLs should be installed under this prefix
162USRDIR="$($PKG_CONFIG --variable=prefix gobject-2.0)"
163AC_SUBST([USRDIR])
164AM_SUBST_NOTMAKE([USRDIR])
165
166dnl -win$ARCH will be appended to the Windows installer file name
167AS_IF([test "x${host_cpu}" = "xx86_64"],[ARCH=64],[ARCH=32])
168AC_SUBST([ARCH])
169AM_SUBST_NOTMAKE([ARCH])
170
171dnl Define LIB_REQUIREMENTS to be used for generating the pkg-config file
172LIB_REQUIREMENTS="glib-2.0 >= glib_prereq, gobject-2.0 >= gobject_prereq, gthread-2.0"
173AC_SUBST([LIB_REQUIREMENTS])
174AM_SUBST_NOTMAKE([LIB_REQUIREMENTS])
175
176dnl Conditional substitution in the ui definition file
177AS_IF([test "x$enable_win32" = "xyes"],
178 [keep='ENABLE_WIN32'; drop='!ENABLE_WIN32'],
179 [keep='!ENABLE_WIN32'; drop='ENABLE_WIN32'])
180AC_CONFIG_COMMANDS([ntdisp.ui],
181 [$SED -i -e "$pattern" src/gtk3/ntdisp.ui],
182 [pattern="/-- if $drop --/,/-- endif --/d;/-- if $keep --/d;/-- endif --/d"])
183
184
185AC_CONFIG_FILES([Makefile
186 build/ntdisp.nsi
187 src/Makefile
188 src/lib/Makefile
189 src/lib/ntdisp.pc
190 src/cli/Makefile
191 src/gtk3/Makefile
192 src/gtk3/ntdisp.ui
193 tests/Makefile
194 docs/Makefile
195 docs/lib/Makefile
196 docs/lib/bookinfo.xml
197 docs/cli/Makefile
198 docs/cli/ntdisp.1])
199AC_OUTPUT
200
201
202# Report
203
204AC_MSG_NOTICE([generating report
205
206AC_PACKAGE_NAME ntdisp_version will be built with the following options:
207------------------------------------------------------
208 Serial communications: ${with_api}
209 Enabled front-ends:${frontends}
210 Enabled back-ends:${backends}
211 Build API reference: ${gtk_doc_report}
212])

Archive Download this file

Branches

Tags