void-packages/srcpkgs/dar/patches/cross-configure_ac.patch

144 lines
5.1 KiB
Diff
Raw Normal View History

2017-01-25 12:58:42 +01:00
Our libgcrypt is recent enough so patch out the tests which
prevent cross compiling dar. Also set the required gettext
version to 0.19 and remove a test for static linking, which
always works for Void Linux.
--- configure.ac 2017-01-21 11:59:32.000000000 +0100
+++ configure.ac 2017-01-25 12:42:51.662888147 +0100
@@ -8,7 +8,7 @@
AM_INIT_AUTOMAKE([subdir-objects])
AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION
+AM_GNU_GETTEXT_VERSION([0.19])
XGETTEXT_EXTRA_OPTIONS='--keyword=dar_gettext'
AM_ICONV
@@ -528,58 +528,10 @@
local_crypto="no"
])
if test "$local_crypto" = "yes" ; then
- min_version_gcrypt="1.4.0"
- AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT, "$min_version_gcrypt", [libgcrypt minimum version])
- min_version_gcrypt_hash_bug="1.6.0"
- AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT_HASH_BUG, "$min_version_gcrypt_hash_bug", [ligcrypt minimum version without hash bug])
- AC_MSG_CHECKING([for libgcrypt usability])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C"
- {
- #if HAVE_GCRYPT_H
- #include <gcrypt.h>
- #endif
- }
- #include <iostream>
- using namespace std;
- ]],
- [[
- if(!gcry_check_version(MIN_VERSION_GCRYPT))
- {
- cout << "ligcrypt version too low, minimum version is " << MIN_VERSION_GCRYPT << endl;
- exit(1);
- }
- else
- exit(0);
- ]])
- ],
- [ AC_DEFINE(CRYPTO_AVAILABLE, 1, [header and linking is available to have strong encryption works])
- AC_MSG_RESULT([ok])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C"
- {
- #if HAVE_GCRYPT_H
- #include <gcrypt.h>
- #endif
- }
- ]],
- [[
- if(!gcry_check_version(MIN_VERSION_GCRYPT_HASH_BUG))
- exit(1);
- else
- exit(0);
- ]])
- ],
- [],
- [ libgcrypt_hash_bug="yes" ])
- ],
- [
- if test "$?" = "1" ; then
- AC_MSG_RESULT([failed: need libgcypt >= $min_version_gcrypt, disabling strong encryption support])
- else
- AC_MSG_RESULT([failed: libgcrypt is unusable, cannot even call gcry_check_version(). Disabling strong encryption support])
- fi
- local_crypto="no"
- ])
- else
+ AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT, "1.4.0", [libgcrypt minimum version])
+ AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT_HASH_BUG, "1.6.0", [ligcrypt minimum version without hash bug])
+ AC_DEFINE(CRYPTO_AVAILABLE, 1, [header and linking is available to have strong encryption works])
+ else
AC_MSG_WARN([strong encryption support not available])
fi
])
@@ -1119,61 +1119,8 @@
],
[])
-
-MEM_LDFLAGS=$LDFLAGS
-MEM_CXXFLAGS=$CXXFLAGS
-LDFLAGS="-static $MEM_LDFLAGS $GPGME_LIBS"
-CXXFLAGS="$CXXFLAGS $GPGME_CFLAGS"
-AC_MSG_CHECKING([static linking])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C" {
- #if HAVE_STDIO_H
- #include <stdio.h>
- #endif
- #if HAVE_EXECINFO_H
- #include <execinfo.h>
- #endif
- #if HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- #if HAVE_PTHREAD_H
- #include <pthread.h>
- #endif
- }
- ]],
- [[
- #if HAVE_EXECINFO_H
- const int buf_size = 20;
- void *buffer[buf_size];
- int size = backtrace(buffer, buf_size);
- char **symbols = backtrace_symbols(buffer, size);
-
- if(symbols != nullptr)
- free(symbols);
- #endif
- #if MUTEX_WORKS
- pthread_mutex_t test;
- if(pthread_mutex_init(&test, NULL) == 0)
- {
- if(pthread_mutex_lock(&test) == 0)
- pthread_mutex_unlock(&test);
- }
- pthread_mutex_destroy(&test);
- #endif
-
- printf("Hello World!");
- return 0;
- ]])
- ],
- [
- AC_MSG_RESULT([yes, perfect!])
- static_pb="no"
- ],
- [
- AC_MSG_RESULT([failed])
- static_pb="yes"
- ])
-LDFLAGS=$MEM_LDFLAGS
-CXXFLAGS=$MEM_CXXFLAGS
+# static linking supported
+static_pb="yes"
AM_CONDITIONAL([MAKE_ALL_DIR], [test $examples = "yes"])
AM_CONDITIONAL([BUILD_DAR_STATIC], [test $build_static = "yes" -a $static_pb = "no"])