-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
253 lines (222 loc) · 6.55 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(rawstudio, 2.1)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AM_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_CXX
AC_HEADER_STDC
AC_ARG_ENABLE(experimental,
AS_HELP_STRING(
[--enable-experimental],
[Enable experimental code (default: disabled)]),
[EXPERIMENTAL=yes]
)
AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
AS_LITERAL_IF([$1],
[AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [
ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
[ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])
AC_MSG_RESULT($ax_check_compiler_flags)
if test "x$ax_check_compiler_flags" = xyes; then
m4_default([$2], :)
else
m4_default([$3], :)
fi
])dnl AX_CHECK_COMPILER_FLAGS
if test "$EXPERIMENTAL" == "yes"; then
AC_DEFINE([EXPERIMENTAL],[1],[Enable experimental code])
fi
dnl libjpeg
if test -z "$LIBJPEG"; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no)
if test "$jpeg_ok" = yes; then
AC_CHECK_HEADER(jpeglib.h, jpeg_ok=yes, jpeg_ok=no)
if test "$jpeg_ok" = yes; then
LIBJPEG='-ljpeg'
else
AC_MSG_ERROR([*** JPEG header files not found.])
fi
else
AC_MSG_ERROR([*** Rawstudio requires libjpeg.])
fi
fi
AC_SUBST(LIBJPEG)
dnl libtiff
if test -z "$LIBTIFF"; then
AC_CHECK_LIB(tiff, TIFFOpen, tiff_ok=yes, tiff_ok=no)
if test "$tiff_ok" = yes; then
AC_CHECK_HEADER(tiffio.h, tiff_ok=yes, tiff_ok=no)
if test "$tiff_ok" = yes; then
LIBTIFF='-ltiff'
else
AC_MSG_ERROR([*** libtiff header files not found.])
fi
else
AC_MSG_ERROR([*** Rawstudio requires libtiff.])
fi
fi
AC_SUBST(LIBTIFF)
pkg_modules="gtk+-2.0 >= 2.8.0 libxml-2.0 >= 2.4 x11 gthread-2.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
PKG_CHECK_MODULES(GCONF, [gconf-2.0 >= 2.0])
AC_SUBST(GCONF_CFLAGS)
AC_SUBST(GCONF_LIBS)
PKG_CHECK_MODULES(SQLITE3, [sqlite3])
AC_SUBST(SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS)
PKG_CHECK_MODULES(LENSFUN, [lensfun])
AC_SUBST(LENSFUN_CFLAGS)
AC_SUBST(LENSFUN_LIBS)
PKG_CHECK_MODULES([LCMS], [lcms2],
[AC_DEFINE([HAVE_LCMS2], [1], [Use LCMS2])],
[PKG_CHECK_MODULES([LCMS], [lcms],
[AC_DEFINE([HAVE_LCMS], [1], [Use LCMS])
], AC_MSG_ERROR([*** liblcms or liblcms2 not found!]))
])
AC_SUBST(LCMS_CFLAGS)
AC_SUBST(LCMS_LIBS)
PKG_CHECK_MODULES(LIBGPHOTO2, [libgphoto2])
AC_SUBST(LIBGPHOTO2_CFLAGS)
AC_SUBST(LIBGPHOTO2_LIBS)
PKG_CHECK_MODULES(EXIV2, [exiv2])
AC_SUBST(EXIV2_CFLAGS)
AC_SUBST(EXIV2_LIBS)
PKG_CHECK_MODULES(FFTW3F, [fftw3f])
AC_SUBST(FFTW3F_CFLAGS)
AC_SUBST(FFTW3F_LIBS)
PKG_CHECK_MODULES(DBUS, [dbus-1])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
PKG_CHECK_MODULES(LIBCURL, [libcurl])
AC_SUBST(LIBCURL_CFLAGS)
AC_SUBST(LIBCURL_LIBS)
PKG_CHECK_MODULES(FLICKCURL, [flickcurl])
AC_SUBST(FLICKCURL_CFLAGS)
AC_SUBST(FLICKCURL_LIBS)
PKG_CHECK_MODULES(OSMGPSMAP, [osmgpsmap])
AC_SUBST(OSMGPSMAP_CFLAGS)
AC_SUBST(OSMGPSMAP_LIBS)
GETTEXT_PACKAGE=rawstudio
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
dnl Add the languages which your application supports here.
ALL_LINGUAS="cs da de en fr it nb pl ru fi es sv nl pt_BR ca hu ja"
AM_GLIB_GNU_GETTEXT
AC_CHECK_FUNCS(memmem)
AX_CHECK_COMPILER_FLAGS("-msse2", [_CAN_COMPILE_SSE2=yes], [_CAN_COMPILE_SSE2=no])
AX_CHECK_COMPILER_FLAGS("-msse4.1", [_CAN_COMPILE_SSE4_1=yes],[_CAN_COMPILE_SSE4_1=no])
AX_CHECK_COMPILER_FLAGS("-mavx", [_CAN_COMPILE_AVX=yes],[_CAN_COMPILE_AVX=no])
AM_CONDITIONAL(CAN_COMPILE_SSE4_1, test "$_CAN_COMPILE_SSE4_1" = yes)
AM_CONDITIONAL(CAN_COMPILE_SSE2, test "$_CAN_COMPILE_SSE2" = yes)
AM_CONDITIONAL(CAN_COMPILE_AVX, test "$_CAN_COMPILE_AVX" = yes)
[
branchname()
{
awk '
/^Repository Root:/ {
root=$3;
}
/^URL:/ {
url=$2;
}
END{
sub(root, "", url);
if (index(url, "/branches/") == 1) {
branch = substr(url, 11);
printf(" (branch %s)", branch);
} else if (index(url, "/tags/") == 1) {
tag = substr(url, 7);
printf(" (tag %s)", tag);
} else {
printf(" (trunk)");
}
}
'
}
if test -f .version ; then
RAWSTUDIO_VERSION=$(cat .version)
else
RAWSTUDIO_VERSION="${VERSION}"
fi
if test -d .svn && svn --version>/dev/null 2>&1 ; then
RAWSTUDIO_SVNREV=$(LC_ALL=C svn info | awk '/^Revision:/ {printf("-svn%s",$2); }')
RAWSTUDIO_BRANCH=$(LC_ALL=C svn info |branchname)
elif test -f .svninfo ; then
RAWSTUDIO_SVNREV=$(awk '/^Revision:/ {printf("-snapshot%s",$2); }' .svninfo)
RAWSTUDIO_BRANCH=$(cat .svninfo|branchname)
else
RAWSTUDIO_SVNREV=""
RAWSTUDIO_BRANCH=""
fi
]
RAWSTUDIO_VERSION="${RAWSTUDIO_VERSION}${RAWSTUDIO_SVNREV}${RAWSTUDIO_BRANCH}"
AC_DEFINE_UNQUOTED([RAWSTUDIO_VERSION], ["$RAWSTUDIO_VERSION"], ["Public revision"])
if test -f .svninfo; then
SVNINFO=".svninfo"
else
SVNINFO=""
fi
AC_SUBST([SVNINFO])
AC_OUTPUT([
Makefile
librawstudio/Makefile
librawstudio/rawstudio-2.1.pc
plugins/Makefile
plugins/cache/Makefile
plugins/colorspace-adobergb/Makefile
plugins/colorspace-prophoto/Makefile
plugins/colorspace-srgb/Makefile
plugins/colorspace-transform/Makefile
plugins/crop/Makefile
plugins/dcp/Makefile
plugins/demosaic/Makefile
plugins/denoise/Makefile
plugins/exposure-mask/Makefile
plugins/fuji-rotate/Makefile
plugins/input-file/Makefile
plugins/input-image16/Makefile
plugins/lensfun/Makefile
plugins/load-dcraw/Makefile
plugins/load-gdk/Makefile
plugins/load-png/Makefile
plugins/load-rawspeed/Makefile
plugins/meta-ciff/Makefile
plugins/meta-exiv2/Makefile
plugins/meta-mrw/Makefile
plugins/meta-raf/Makefile
plugins/meta-tiff/Makefile
plugins/meta-x3f/Makefile
plugins/output-jpegfile/Makefile
plugins/output-pngfile/Makefile
plugins/output-picasa/Makefile
plugins/output-facebook/Makefile
plugins/output-flickr/Makefile
plugins/output-tifffile/Makefile
plugins/resample/Makefile
plugins/rotate/Makefile
src/Makefile
po/Makefile.in
pixmaps/Makefile
profiles/Makefile
])