forked from kwalus/QCADesigner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
255 lines (221 loc) · 7.05 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
dnl ===========================================================================
dnl === Init ===
dnl ===========================================================================
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(QCADesigner, 2.0.3)
AM_MAINTAINER_MODE
dnl ===========================================================================
dnl === Preamble ===
dnl ===========================================================================
AC_ISC_POSIX
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_RANLIB
dnl AC_PROG_CXX
AM_PROG_CC_STDC
AM_PROG_CC_C_O
AC_HEADER_STDC
dnl ===========================================================================
dnl === Extra arguments ===
dnl ===========================================================================
AC_ARG_WITH(
svgpix,
[ --with-svgpix[[=ARG]] use SVG icons ARG=[[detect]]|yes|no ],
[ svgpix=$withval ],
[ svgpix=detect ])
AC_ARG_WITH(
f2c-inc-path,
[ --with-f2c-inc-path=<absolute_path> Absolute path to f2c header file (f2c.h). Default: none ],
[ f2cincpath=$withval ],
[ f2cincpath="" ])
AC_ARG_WITH(
f2c-lib-path,
[ --with-f2c-lib-path=<absolute_path> Absolute path to f2c libraries. Default: none ],
[ f2clibpath=$withval ],
[ f2clibpath="" ])
AC_ARG_WITH(
blaswrap-inc-path,
[ --with-blaswrap-inc-path=<absolute_path> Absolute path to blaswrap header file (blaswrap.h). Default: none ],
[ blaswrapincpath=$withval ],
[ blaswrapincpath="" ])
AC_ARG_WITH(
blas-lib-path,
[ --with-blas-lib-path=<absolute_path> Absolute path to BLAS library. Default: none ],
[ blaslibpath=$withval ],
[ blaslibpath="" ])
AC_ARG_WITH(
clapack-inc-path,
[ --with-clapack-inc-path=<absolute_path> Absolute path to CLAPACK header file (clapack.h). Default: none ],
[ clapackincpath=$withval ],
[ clapackincpath="" ])
AC_ARG_WITH(
clapack-lib-path,
[ --with-clapack-lib-path=<absolute_path> Absolute path to CLAPACK library. Default: none ],
[ clapacklibpath=$withval ],
[ clapacklibpath="" ])
dnl ===========================================================================
dnl === Package checks ===
dnl ===========================================================================
dnl === f2c
AC_MSG_CHECKING([for f2c headers])
HAVE_F2C_FLAGS=0
if test -f "${f2cincpath}/f2c.h"; then
HAVE_F2C_CFLAGS=1
F2C_CFLAGS="-I${f2cincpath}"
AC_MSG_RESULT([yes])
fi
if test "x$HAVE_F2C_CFLAGS" != "x1"; then
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for f2c libs])
HAVE_F2C_LIBS=0
if test "x$f2clibpath" != "x"; then
if test -f "${f2clibpath}/libF77.a" && test -f "${f2clibpath}/libI77.a"; then
HAVE_F2C_LIBS=1
F2C_LIBS="${f2clibpath}/libF77.a ${f2clibpath}/libI77.a"
AC_MSG_RESULT([yes])
fi
fi
if test "x$HAVE_F2C_LIBS" != "x1"; then
AC_MSG_RESULT([no])
fi
dnl === blaswrap
AC_MSG_CHECKING([for BLAS headers])
HAVE_BLAS_CFLAGS=0
if test "x$blaswrapincpath" != "x"; then
if test -f "${blaswrapincpath}/blaswrap.h"; then
AC_DEFINE(NO_BLAS_WRAP)
BLAS_CFLAGS="-I${blaswrapincpath}"
HAVE_BLAS_CFLAGS=1
AC_MSG_RESULT([yes])
fi
fi
if test "x$HAVE_BLAS_CFLAGS" != "x1"; then
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for BLAS libs])
HAVE_BLAS_LIBS=0
if test "x$blaslibpath" != "x"; then
if test -f "${blaslibpath}/blas_LINUX.a"; then
HAVE_BLAS_LIBS=1
BLAS_LIBS="${blaslibpath}/blas_LINUX.a"
AC_MSG_RESULT([yes])
fi
fi
if test "x$HAVE_BLAS_LIBS" != "x1"; then
AC_MSG_RESULT([no])
fi
dnl === clapack
AC_MSG_CHECKING([for CLAPACK headers])
HAVE_CLAPACK_CFLAGS=0
if test "x$clapackincpath" != "x"; then
if test -f "${clapackincpath}/clapack.h"; then
HAVE_CLAPACK_CFLAGS=1
CLAPACK_CFLAGS="-I${clapackincpath}"
AC_MSG_RESULT([yes])
fi
fi
if test "x$HAVE_CLAPACK_CFLAGS" != "x1"; then
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for CLAPACK libs])
HAVE_CLAPACK_LIBS=0
if test "x$clapacklibpath" != "x"; then
if test -f "${clapacklibpath}/lapack_LINUX.a"; then
HAVE_CLAPACK_LIBS=1
CLAPACK_LIBS="${clapacklibpath}/lapack_LINUX.a"
AC_MSG_RESULT([yes])
fi
fi
if test "x$HAVE_CLAPACK_LIBS" != "x1"; then
AC_MSG_RESULT([no])
fi
HAVE_FORTRAN=0
if test "x${HAVE_F2C_CFLAGS}${HAVE_F2C_LIBS}${HAVE_BLAS_CFLAGS}${HAVE_BLAS_LIBS}${HAVE_CLAPACK_CFLAGS}${HAVE_CLAPACK_LIBS}" = "x111111"; then
FORTRAN_CFLAGS="${F2C_CFLAGS} ${BLAS_CFLAGS} ${CLAPACK_CFLAGS}"
FORTRAN_LIBS="${CLAPACK_LIBS} ${BLAS_LIBS} ${F2C_LIBS}"
AC_SUBST(FORTRAN_CFLAGS)
AC_SUBST(FORTRAN_LIBS)
AC_DEFINE(HAVE_FORTRAN)
HAVE_FORTRAN=1
fi
dnl === librsvg
ICON_EXT="_0_48x48x24a.png"
if test "x$svgpix" != "xno"; then
PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0,
[
AC_DEFINE(HAVE_LIBRSVG)
ICON_EXT=".svg"
],
[
if test "x$svgpix" = "xyes"; then
AC_ERROR([ Cannot find librsvg. Install librsvg and its devel files or turn off --with-svgpix ])
fi
])
fi
AC_SUBST(ICON_EXT)
dnl === gtk
PKG_CHECK_MODULES(GTK, [ gtk+-2.0 >= 2.2.0 ])
dnl === gthread
PKG_CHECK_MODULES(GTHREAD, [ gthread-2.0 >= 2.0.0 ])
if echo "$build" | grep "solaris" > /dev/null; then
AC_MSG_CHECKING(for Sun WorkShop compiler)
if ${CC} -V 2>&1 | grep 'Sun WorkShop' > /dev/null; then
GTHREAD_CFLAGS=`echo ${GTHREAD_CFLAGS} | sed 's/-threads//g'`
GTHREAD_LIBS=`echo ${GTHREAD_LIBS} | sed 's/-threads//g'`
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
dnl === glib
PKG_CHECK_MODULES(GLIB, [ glib-2.0 >= 2.0 ])
dnl === gobject
PKG_CHECK_MODULES(GOBJECT, [ gobject-2.0 >= 2.0 ])
dnl ===========================================================================
dnl === gettext ===
dnl ===========================================================================
GETTEXT_PACKAGE=QCADesigner
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
ALL_LINGUAS="de hu ro fr pl it"
AM_GLIB_GNU_GETTEXT
dnl ===========================================================================
dnl === misc ===
dnl ===========================================================================
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
if echo $build | grep -q cygwin ; then
if test -x /usr/bin/cygpath ; then
packagesrcdir=`cygpath -dm ${packagesrcdir}`
prefix=`cygpath -dm ${prefix}`
fi
fi
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", PACKAGE_SOURCE_DIR)
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
AC_SUBST(VERSION)
AC_SUBST(prefix)
AC_SUBST(packagesrcdir)
dnl GTK_DOC_CHECK(1.4)
AC_OUTPUT([
Makefile
src/Makefile
po/Makefile.in
docs/Makefile
docs/reference/Makefile
pixmaps/Makefile
QCADesigner.desktop
graph_dialog.desktop
QCADesigner.spec
QCADesigner-win32.iss
QCADesigner-win32-gtk.iss
])