1 --- MEGAsync_ori/src/MEGASync/mega/configure.ac Wed Mar 9 01:46:53 2022
2 +++ MEGAsync_patched/src/MEGASync/mega/configure.ac Mon Feb 28 22:19:04 2022
4 AC_INIT([libmega], m4_esyscmd([ grep define < include/mega/version.h | awk '{print $3}' | awk 'BEGIN { RS = "" ; FS = "\n" } {printf $1"."$2"."$3}']), [https://github.com/meganz/sdk])
6 #override default /usr/local prefix
7 -AC_PREFIX_DEFAULT([/])
8 +AC_PREFIX_DEFAULT([/usr])
15 # determine if library is installed
16 - if test -d "$with_cryptopp/lib"; then
17 - LDFLAGS="-L$with_cryptopp/lib $LDFLAGS"
18 + if test -d "$with_cryptopp/lib/amd64"; then
19 + LDFLAGS="-L$with_cryptopp/lib/amd64 $LDFLAGS"
20 CXXFLAGS="-I$with_cryptopp/include $CXXFLAGS"
21 CPPFLAGS="-I$with_cryptopp/include $CPPFLAGS"
24 AC_CHECK_HEADERS(cryptopp/cryptlib.h,
25 CRYPTO_CXXFLAGS="-I$with_cryptopp/include"
26 CRYPTO_CPPFLAGS="-I$with_cryptopp/include"
27 - CRYPTO_LDFLAGS="-L$with_cryptopp/lib",
28 + CRYPTO_LDFLAGS="-L$with_cryptopp/lib/amd64",
29 AC_MSG_ERROR([cryptopp/cryptlib.h header not found or not usable])
31 # assume we are using crypto source directory
35 # determine if library is installed
36 - if test -d "$with_sodium/lib"; then
37 - LDFLAGS="-L$with_sodium/lib $LDFLAGS"
38 + if test -d "$with_sodium/lib/amd64"; then
39 + LDFLAGS="-L$with_sodium/lib/amd64 $LDFLAGS"
40 CXXFLAGS="-I$with_sodium/include $CXXFLAGS"
41 CPPFLAGS="-I$with_sodium/include $CPPFLAGS"
44 AC_CHECK_HEADERS(sodium.h,
45 SODIUM_CXXFLAGS="-I$with_sodium/include"
46 SODIUM_CPPFLAGS="-I$with_sodium/include"
47 - SODIUM_LDFLAGS="-L$with_sodium/lib",
48 + SODIUM_LDFLAGS="-L$with_sodium/lib/amd64",
49 AC_MSG_ERROR([sodium/sodium.h header not found or not usable])
51 # assume we are using sodium source directory
55 # determine if library is installed
56 - if test -d "$with_pcre/lib64"; then
57 - LDFLAGS="-L$with_pcre/lib64 $LDFLAGS"
58 - CXXFLAGS="-I$with_pcre/include $CXXFLAGS"
59 - CPPFLAGS="-I$with_pcre/include $CPPFLAGS"
60 + if test -d "$with_pcre/lib/amd64"; then
61 + LDFLAGS="-L$with_pcre/lib/amd64 $LDFLAGS"
62 + CXXFLAGS="-I$with_pcre/include/pcre $CXXFLAGS"
63 + CPPFLAGS="-I$with_pcre/include/pcre $CPPFLAGS"
65 AC_CHECK_HEADERS(pcrecpp.h,
66 - PCRE_CXXFLAGS="-I$with_pcre/include"
67 - PCRE_CPPFLAGS="-I$with_pcre/include"
68 - PCRE_LDFLAGS="-L$with_pcre/lib64",
69 + PCRE_CXXFLAGS="-I$with_pcre/include/pcre"
70 + PCRE_CPPFLAGS="-I$with_pcre/include/pcre"
71 + PCRE_LDFLAGS="-L$with_pcre/lib/amd64",
72 AC_MSG_ERROR([pcrecpp.h header not found or not usable])
75 - LDFLAGS="-L$with_pcre/lib32 $LDFLAGS"
76 - CXXFLAGS="-I$with_pcre/include $CXXFLAGS"
77 - CPPFLAGS="-I$with_pcre/include $CPPFLAGS"
78 + LDFLAGS="-L$with_pcre/lib $LDFLAGS"
79 + CXXFLAGS="-I$with_pcre/include/pcre $CXXFLAGS"
80 + CPPFLAGS="-I$with_pcre/include/pcre $CPPFLAGS"
82 AC_CHECK_HEADERS(pcrecpp.h,
83 - PCRE_CXXFLAGS="-I$with_pcre/include"
84 - PCRE_CPPFLAGS="-I$with_pcre/include"
85 - PCRE_LDFLAGS="-L$with_pcre/lib32",
86 + PCRE_CXXFLAGS="-I$with_pcre/include/pcre"
87 + PCRE_CPPFLAGS="-I$with_pcre/include/pcre"
88 + PCRE_LDFLAGS="-L$with_pcre/lib",
89 AC_MSG_ERROR([pcrecpp.h header not found or not usable])
95 # determine if library is installed
96 - if test -d "$with_libraw/lib"; then
97 - LDFLAGS="-L$with_libraw/lib $LDFLAGS"
98 + if test -d "$with_libraw/lib/amd64"; then
99 + LDFLAGS="-L$with_libraw/lib/amd64 $LDFLAGS"
100 CXXFLAGS="-I$with_libraw/include $CXXFLAGS"
101 CPPFLAGS="-I$with_libraw/include $CPPFLAGS"
104 AC_CHECK_HEADERS(libraw/libraw.h,
105 LIBRAW_CXXFLAGS="-I$with_libraw/include"
106 LIBRAW_CPPFLAGS="-I$with_libraw/include"
107 - LIBRAW_LDFLAGS="-L$with_libraw/lib",
108 + LIBRAW_LDFLAGS="-L$with_libraw/lib/amd64",
109 AC_MSG_ERROR([libraw/libraw.h header not found or not usable])
112 @@ -771,21 +771,21 @@
116 - if test -f "$with_libuv/lib/pkgconfig/libuv.pc"; then
117 - UV_LIBS=`cat $with_libuv/lib/pkgconfig/libuv.pc | grep "Libs:" | awk '{$1=""; $2=""; print $0}'`
118 + if test -f "$with_libuv/lib/amd64/pkgconfig/libuv.pc"; then
119 + UV_LIBS=`cat $with_libuv/lib/amd64/pkgconfig/libuv.pc | grep "Libs:" | awk '{$1=""; $2=""; print $0}'`
123 # determine if library is installed
124 - if test -d "$with_libuv/lib"; then
125 - LIBS="-L$with_libuv/lib $UV_LIBS $LIBS" #TODO: These are actually lost: let's assume these library dependencies are included somewhere else
126 - LDFLAGS="-L$with_libuv/lib $UV_LDFLAGS $LDFLAGS"
127 + if test -d "$with_libuv/lib/amd64"; then
128 + LIBS="-L$with_libuv/lib/amd64 $UV_LIBS $LIBS" #TODO: These are actually lost: let's assume these library dependencies are included somewhere else
129 + LDFLAGS="-L$with_libuv/lib/amd64 $UV_LDFLAGS $LDFLAGS"
130 CXXFLAGS="-I$with_libuv/include $UV_CXXFLAGS $CXXFLAGS"
131 CPPFLAGS="-I$with_libuv/include $UV_CPPFLAGS $CPPFLAGS"
132 AC_CHECK_HEADERS(uv.h,
133 LIBUV_CXXFLAGS="-I$with_libuv/include"
134 LIBUV_CPPFLAGS="-I$with_libuv/include"
135 - LIBUV_LDFLAGS="-L$with_libuv/lib",
136 + LIBUV_LDFLAGS="-L$with_libuv/lib/amd64",
137 AC_MSG_ERROR([uv.h header not found or not usable])
139 # assume we are using libuv source directory
144 - if test -d "$with_zlib/lib"; then
145 - LDFLAGS="-L$with_zlib/lib $LDFLAGS"
146 + if test -d "$with_zlib/lib/amd64"; then
147 + LDFLAGS="-L$with_zlib/lib/amd64 $LDFLAGS"
148 CXXFLAGS="-I$with_zlib/include $CXXFLAGS"
149 CPPFLAGS="-I$with_zlib/include $CPPFLAGS"
152 AC_CHECK_HEADERS(zlib.h,
153 ZLIB_CXXFLAGS="-I$with_zlib/include"
154 ZLIB_CPPFLAGS="-I$with_zlib/include"
155 - ZLIB_LDFLAGS="-L$with_zlib/lib",
156 + ZLIB_LDFLAGS="-L$with_zlib/lib/amd64",
157 AC_MSG_ERROR([zlib.h header not found or not usable])
160 @@ -965,12 +965,12 @@
163 # determine if library is installed
164 - if test -d "$with_sqlite/lib"; then
165 - LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
166 + if test -d "$with_sqlite/lib/amd64"; then
167 + LDFLAGS="-L$with_sqlite/lib/amd64 $LDFLAGS"
168 CXXFLAGS="-I$with_sqlite/include $CXXFLAGS"
170 AC_CHECK_HEADERS(sqlite3.h,[
171 - DB_LDFLAGS="-L$with_sqlite/lib"
172 + DB_LDFLAGS="-L$with_sqlite/lib/amd64"
173 DB_CXXFLAGS="-I$with_sqlite/include"
174 DB_CPPFLAGS="-I$with_sqlite/include"],
175 AC_MSG_ERROR([sqlite3.h header not found or not usable])
176 @@ -1046,7 +1046,7 @@
179 AC_CHECK_HEADERS([ffmpeg-mega/libavutil/macros.h],
180 - # LDFLAGS="-L$with_ffmpeg/lib $LDFLAGS"
181 + # LDFLAGS="-L$with_ffmpeg/lib/amd64 $LDFLAGS"
182 CXXFLAGS="-I/usr/include/ffmpeg-mega $CXXFLAGS"
183 CPPFLAGS="-I/usr/include/ffmpeg-mega $CPPFLAGS"
185 @@ -1079,7 +1079,7 @@
186 [AC_MSG_RESULT([--with-ffmpeg not specified])
188 AC_CHECK_HEADERS([ffmpeg-mega/libavutil/macros.h],
189 - # LDFLAGS="-L$with_ffmpeg/lib $LDFLAGS"
190 + # LDFLAGS="-L$with_ffmpeg/lib/amd64 $LDFLAGS"
191 CXXFLAGS="-I/usr/include/ffmpeg-mega $CXXFLAGS"
192 CPPFLAGS="-I/usr/include/ffmpeg-mega $CPPFLAGS"
194 @@ -1139,8 +1139,8 @@
197 # determine if library is installed
198 - if test -d "$with_libzen/lib"; then
199 - LDFLAGS="-L$with_libzen/lib $LDFLAGS"
200 + if test -d "$with_libzen/lib/amd64"; then
201 + LDFLAGS="-L$with_libzen/lib/amd64 $LDFLAGS"
202 CXXFLAGS="-I$with_libzen/include $CXXFLAGS"
203 CPPFLAGS="-I$with_libzen/include $CPPFLAGS"
205 @@ -1147,7 +1147,7 @@
206 AC_CHECK_HEADERS(ZenLib/Ztring.h,
207 LIBZEN_CXXFLAGS="-I$with_libzen/include"
208 LIBZEN_CPPFLAGS="-I$with_libzen/include"
209 - LIBZEN_LDFLAGS="-L$with_libzen/lib",
210 + LIBZEN_LDFLAGS="-L$with_libzen/lib/amd64",
211 AC_MSG_ERROR([ZenLib/Ztring.h header not found or not usable])
213 # assume we are using libzen source directory
214 @@ -1233,8 +1233,8 @@
217 # determine if library is installed
218 - if test -d "$with_libmediainfo/lib"; then
219 - LDFLAGS="$LIBZEN_LDFLAGS $ZLIB_LDFLAGS -L$with_libmediainfo/lib $LDFLAGS"
220 + if test -d "$with_libmediainfo/lib/amd64"; then
221 + LDFLAGS="$LIBZEN_LDFLAGS $ZLIB_LDFLAGS -L$with_libmediainfo/lib/amd64 $LDFLAGS"
222 CXXFLAGS="$LIBZEN_CXXFLAGS $ZLIB_CXXFLAGS -I$with_libmediainfo/include $CXXFLAGS"
223 CPPFLAGS="$LIBZEN_CPPFLAGS $ZLIB_CPPFLAGS -I$with_libmediainfo/include $CPPFLAGS"
225 @@ -1241,7 +1241,7 @@
226 AC_CHECK_HEADERS(MediaInfo/MediaInfo.h,
227 LIBMEDIAINFO_CXXFLAGS="$LIBZEN_CXXFLAGS -I$with_libmediainfo/include"
228 LIBMEDIAINFO_CPPFLAGS="$LIBZEN_CPPFLAGS -I$with_libmediainfo/include"
229 - LIBMEDIAINFO_LDFLAGS="$LIBZEN_LDFLAGS -L$with_libmediainfo/lib",
230 + LIBMEDIAINFO_LDFLAGS="$LIBZEN_LDFLAGS -L$with_libmediainfo/lib/amd64",
231 AC_MSG_ERROR([MediaInfo/MediaInfo.h header not found or not usable])
233 # assume we are using libmediainfo source directory
234 @@ -1299,32 +1299,7 @@
235 LDFLAGS="$LIBMEDIAINFO_LDFLAGS"
236 CXXFLAGS="$LIBMEDIAINFO_CXXFLAGS"
237 CPPFLAGS="$LIBMEDIAINFO_CPPFLAGS"
238 - lmediainfo_prog='#include <iostream>
239 - #include "ZenLib/Ztring.h"
240 - #include "MediaInfo/MediaInfo.h"
241 - int main () { std::cout << ZenLib::Ztring(MediaInfoLib::MediaInfo::Option_Static(__T("Info_Version")).c_str()).To_Local().c_str() << std::endl; }
245 - [AC_LANG_SOURCE($lmediainfo_prog)],
246 - AC_MSG_RESULT([libmediainfo worked]),
247 - #Try again with -DUNICODE
248 - LIBMEDIAINFO_LDFLAGS="$LIBMEDIAINFO_LDFLAGS -DUNICODE"
249 - LDFLAGS="$LIBMEDIAINFO_LDFLAGS"
251 - [AC_LANG_SOURCE($lmediainfo_prog)],
252 - AC_MSG_RESULT([libmediainfo worked worked with -DUNICODE])
253 - AC_DEFINE(UNICODE, [1], [Define to use UNICODE (for MediaInfo)])
255 - AC_MSG_RESULT([libmediainfo failed to compile. Discarded])
257 - unset LIBMEDIAINFO_CXXFLAGS
258 - unset LIBMEDIAINFO_CPPFLAGS
259 - unset LIBMEDIAINFO_LDFLAGS
260 - unset LIBMEDIAINFO_LIBS
265 LDFLAGS=$SAVE_LDFLAGS
266 CXXFLAGS=$SAVE_CXXFLAGS
267 @@ -1394,10 +1369,10 @@
270 # determine if library is installed
271 - LDFLAGS="-L$with_openssl/lib $LDFLAGS"
272 + LDFLAGS="-L$with_openssl/lib/amd64 $LDFLAGS"
273 CXXFLAGS="-I$with_openssl/include $CXXFLAGS"
275 - LIBSSL_LDFLAGS="-L$with_openssl/lib"
276 + LIBSSL_LDFLAGS="-L$with_openssl/lib/amd64"
277 LIBSSL_FLAGS="-I$with_openssl/include"
279 LIBS="-lcrypto $LIBS"
280 @@ -1460,10 +1435,10 @@
283 # determine if library is installed
284 - LDFLAGS="-L$with_cares/lib $LDFLAGS"
285 + LDFLAGS="-L$with_cares/lib/amd64 $LDFLAGS"
286 CXXFLAGS="-I$with_cares/include $CXXFLAGS"
288 - CARES_LDFLAGS="-L$with_cares/lib"
289 + CARES_LDFLAGS="-L$with_cares/lib/amd64"
290 CARES_FLAGS="-I$with_cares/include"
292 AC_CHECK_HEADERS([ares.h], [],
293 @@ -1631,7 +1606,7 @@
299 AC_MSG_CHECKING(for FreeImage)
300 AC_ARG_WITH(freeimage,
301 AS_HELP_STRING(--with-freeimage=PATH, base of FreeImage installation),
302 @@ -1644,8 +1619,8 @@
303 AC_CHECK_HEADERS([FreeImage.h],, [
304 AC_MSG_ERROR([FreeImage.h header not found or not usable])
306 - AC_CHECK_LIB([freeimage], [main], [FI_LIBS="-lfreeimage"], [
307 - AC_MSG_ERROR([FreeImage library is not found!])])
308 + #AC_CHECK_LIB([freeimage], [main], [FI_LIBS="-lfreeimage"], [
309 + # AC_MSG_ERROR([FreeImage library is not found!])])
313 @@ -1652,13 +1627,13 @@
316 # determine if library is installed
317 - if test -d "$with_freeimage/lib"; then
318 - LDFLAGS="-L$with_freeimage/lib $LDFLAGS"
319 + if test -d "$with_freeimage/lib/amd64"; then
320 + LDFLAGS="-L$with_freeimage/lib/amd64 $LDFLAGS"
321 CXXFLAGS="-I$with_freeimage/include $CXXFLAGS"
322 CPPFLAGS="-I$with_freeimage/include $CPPFLAGS"
324 AC_CHECK_HEADERS([FreeImage.h],[
325 - FI_LDFLAGS="-L$with_freeimage/lib"
326 + FI_LDFLAGS="-L$with_freeimage/lib/amd64"
327 FI_CXXFLAGS="-I$with_freeimage/include"
328 FI_CPPFLAGS="-I$with_freeimage/include"],
329 AC_MSG_ERROR([FreeImage.h header not found or not usable])
330 @@ -1677,8 +1652,8 @@
333 # check and set FI library
334 - AC_CHECK_LIB([freeimage], [main], [FI_LIBS="-lfreeimage"], [
335 - AC_MSG_ERROR([FreeImage library is not found!])])
336 + #AC_CHECK_LIB([freeimage], [main], [FI_LIBS="-lfreeimage"], [
337 + # AC_MSG_ERROR([FreeImage library is not found!])])
340 LDFLAGS=$SAVE_LDFLAGS
341 @@ -1698,6 +1673,8 @@
345 +FI_LDFLAGS=-L/usr/lib/amd64
349 if test x$enable_static = xyes; then
350 @@ -1734,13 +1711,13 @@
353 # determine if library is installed
354 - if test -d "$with_pdfium/lib"; then
355 - LDFLAGS="-L$with_pdfium/lib $LDFLAGS"
356 + if test -d "$with_pdfium/lib/amd64"; then
357 + LDFLAGS="-L$with_pdfium/lib/amd64 $LDFLAGS"
358 CXXFLAGS="-I$with_pdfium/include $CXXFLAGS"
359 CPPFLAGS="-I$with_pdfium/include $CPPFLAGS"
361 AC_CHECK_HEADERS([fpdfview.h],[
362 - PDF_LDFLAGS="-L$with_pdfium/lib"
363 + PDF_LDFLAGS="-L$with_pdfium/lib/amd64"
364 PDF_CXXFLAGS="-I$with_pdfium/include"
365 PDF_CPPFLAGS="-I$with_pdfium/include"],
366 AC_MSG_ERROR([fpdfview.h header not found or not usable])
367 @@ -1804,13 +1781,13 @@
370 # determine if library is installed
371 - if test -d "$with_termcap/lib"; then
372 - LDFLAGS="-L$with_termcap/lib $LDFLAGS"
373 + if test -d "$with_termcap/lib/amd64"; then
374 + LDFLAGS="-L$with_termcap/lib/amd64 $LDFLAGS"
375 CXXFLAGS="-I$with_termcap/include $CXXFLAGS"
376 CPPFLAGS="-I$with_termcap/include $CPPFLAGS"
378 AC_CHECK_HEADERS([termcap.h],[
379 - TERMCAP_LDFLAGS="-L$with_termcap/lib"
380 + TERMCAP_LDFLAGS="-L$with_termcap/lib/amd64"
381 TERMCAP_CXXFLAGS="-I$with_termcap/include"
382 TERMCAP_CPPFLAGS="-I$with_termcap/include"],
383 AC_MSG_NOTICE([termcap.h header not found or not usable])
384 @@ -1873,8 +1850,8 @@
387 # determine if library is installed
388 - if test -d "$with_readline/lib"; then
389 - LDFLAGS="-L$with_readline/lib $LDFLAGS"
390 + if test -d "$with_readline/lib/amd64"; then
391 + LDFLAGS="-L$with_readline/lib/amd64 $LDFLAGS"
392 CXXFLAGS="-I$with_readline/include $CXXFLAGS"
393 CPPFLAGS="-I$with_readline/include $CPPFLAGS"
394 AC_CHECK_HEADERS([readline/readline.h], [
395 @@ -1948,7 +1925,7 @@
399 - LDFLAGS="-L$with_fuse/lib $LDFLAGS"
400 + LDFLAGS="-L$with_fuse/lib/amd64 $LDFLAGS"
401 CXXFLAGS="-I$with_fuse/include $CXXFLAGS -D_FILE_OFFSET_BITS=64"
402 CPPFLAGS="-I$with_fuse/include $CPPFLAGS -D_FILE_OFFSET_BITS=64"