1
0
Fork 0
mirror of git://git.psyced.org/git/psyclpc synced 2024-08-15 03:20:16 +00:00

configure: detect gnunet and newer libpsyc

This commit is contained in:
psyc://loupsycedyglgamf.onion/~lynX 2016-02-16 07:07:27 +00:00
parent e2fc8167f8
commit f83c866a1f
5 changed files with 78 additions and 10 deletions

View file

@ -1,3 +1,6 @@
CPPFLAGS=-I/usr/depot/include
LDFLAGS=-L/usr/depot/lib -lpsyc -lgnunetutil -lgnunetcadet
../configure-do: configure.in configure.head Makefile
autoreconf
rm -f $@

View file

@ -117,6 +117,7 @@ AC_MY_ARG_ENABLE(use-system-crypt,yes,,)
AC_MY_ARG_ENABLE(udp-send,yes,,)
AC_MY_ARG_ENABLE(use-ipv6,no,,[Enables support for IPv6])
AC_MY_ARG_ENABLE(use-alists,no,,[Enables alist support])
AC_MY_ARG_ENABLE(use-gnunet,no,,[Enables GNUnet support])
AC_MY_ARG_ENABLE(use-psyc,no,,[Enables libpsyc support])
AC_MY_ARG_ENABLE(use-mccp,no,,[Enables MCCP support])
AC_MY_ARG_ENABLE(use-mysql,no,,[Enables mySQL support])
@ -1214,9 +1215,48 @@ else
enable_use_pthreads=no
fi
# --- GNUnet ---
echo "--- GNUnet"
lp_cv_has_gnunet_lib="no"
AC_CHECK_LIB(gnunetcadet,main, lp_cv_has_gnunet_lib="yes")
if test $lp_cv_has_gnunet_lib = yes; then
LIBS="-lgnunetutil -lgnunetcadet"
AC_CACHE_CHECK(for GNUnet crypto,lp_cv_has_gnunet,
AC_TRY_RUN([
#include <gnunet/platform.h>
#include <gnunet/gnunet_crypto_lib.h>
#include <gnunet/gnunet_common.h>
#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_cadet_service.h>
int main(void) {
const struct GNUNET_HashCode *hash = GC_u2h (4404);
const char* expect = "VFQCGVPZJJ6PHN5DQ6NWH1BJY3Q3SNF0BVCT2B1S4Q915SMYHDRW1X2BFTEEWXG9ZC23PVH3Y1W6D4DRKRTHV2CFGHAW66W52QGM0B8";
printf( "u2h(4404) = %s ... ", GNUNET_h2s( hash ) );
if (strcmp(expect, GNUNET_h2s_full( hash ))) return -1;
return 0;
}
],
lp_cv_has_gnunet=yes,
lp_cv_has_gnunet=no
))
CFLAGS="$saveflags"
if test $lp_cv_has_gnunet = yes; then
AC_DEFINE(HAS_GNUNET, 1, [Does the machine offer GNUnet?])
PKGLIBS="$PKGLIBS $LIBS"
echo ">>> Congrats! GNUnet CADET is available."
else
echo "GNUnet CADET not available on this system yet."
fi
fi
# --- libpsyc ---
echo "*** libpsyc"
echo "--- libpsyc"
lp_cv_has_psyc_lib="no"
AC_CHECK_LIB(psyc,main, lp_cv_has_psyc_lib="yes")
@ -1224,13 +1264,16 @@ AC_CHECK_LIB(psyc,main, lp_cv_has_psyc_lib="yes")
# dont know why this fails on bsd, had to patch machine.h manually... FIXME
if test $lp_cv_has_psyc_lib = yes; then
LIBS="-lpsyc"
AC_CACHE_CHECK(for libpsyc usability,lp_cv_has_psyc,
AC_CACHE_CHECK(for libpsyc functionality,lp_cv_has_psyc,
AC_TRY_RUN([
#include <stdio.h>
#include <psyc.h>
int main(void) {
(void) psyc_version();
return 0;
size_t tlen = 0;
const char *t = psyc_template(PSYC_MC_REQUEST_CONTEXT_ENTER, &tlen);
printf("%s ... ", t);
return PSYC_VERSION ? 0 : -1;
}
],
lp_cv_has_psyc=yes,
@ -1240,8 +1283,8 @@ int main(void) {
if test $lp_cv_has_psyc = yes; then
AC_DEFINE(HAS_PSYC, 1, [Does the machine offer libpsyc?])
PKGLIBS="$PKGLIBS -lpsyc"
echo "Congrats! libpsyc is available on this system."
PKGLIBS="$PKGLIBS $LIBS"
echo ">>> Congrats! libpsyc is available on this system."
else
echo "libpsyc not available on this system yet."
fi
@ -1256,7 +1299,7 @@ if test $lp_cv_has_pcre_lib = yes; then
# saveflags="$CFLAGS"
# CFLAGS="$CFLAGS -lpcre"
LIBS="-lpcre"
AC_CACHE_CHECK(for PCRE usability,lp_cv_has_pcre,
AC_CACHE_CHECK(for PCRE functionality,lp_cv_has_pcre,
AC_TRY_RUN([
#include <pcre.h>
@ -1288,7 +1331,7 @@ fi
# --- iconv ---
echo "*** libiconv"
echo "--- libiconv"
# iconv in glibc 2.2.5 is broken - but not every system even
# uses glibc.
changequote(,)dnl
@ -1441,7 +1484,7 @@ if test "x$lp_cv_has_iconv_nonconst_in" = "xyes"; then
fi
# --- libidn ---
echo "*** libidn"
echo "--- libidn"
AC_CHECK_HEADER(idna.h, lp_cv_has_idn=yes,lp_cv_has_idn=no)
AC_CHECK_HEADER(stringprep.h, lp_cv_has_idn=yes,lp_cv_has_idn=no)

View file

@ -0,0 +1,12 @@
#include <gnunet/platform.h>
#include <gnunet/gnunet_crypto_lib.h>
#include <gnunet/gnunet_common.h>
#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_cadet_service.h>
int main(void) {
const struct GNUNET_HashCode *hash = GC_u2h (4404);
puts( GNUNET_h2s_full( hash ) );
return 0;
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
#include <psyc.h>
int main(void) {
size_t tlen = 0;
const char *t = psyc_template(PSYC_MC_REQUEST_CONTEXT_ENTER, &tlen);
puts(t);
return PSYC_VERSION ? 0 : -1;
}

2
src/configure vendored
View file

@ -6,4 +6,4 @@ if test ! -f "configure-do" ; then
fi
# then run it with psyced defaults
settings/psyced
settings/psyced $*