Skip to content

Commit

Permalink
buildsys: check for libqrencode
Browse files Browse the repository at this point in the history
  • Loading branch information
kaniini committed Jan 15, 2014
1 parent c085b83 commit 8197c48
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 37 deletions.
153 changes: 118 additions & 35 deletions configure
Expand Up @@ -633,6 +633,8 @@ LIBMOWGLI
subdirs
MOWGLI_LIBS
MOWGLI_CFLAGS
LIBQRENCODE_LIBS
LIBQRENCODE_CFLAGS
JANSSON_LIBS
JANSSON_CFLAGS
SSL_LIBS
Expand Down Expand Up @@ -796,6 +798,8 @@ CPP
PKG_CONFIG
JANSSON_CFLAGS
JANSSON_LIBS
LIBQRENCODE_CFLAGS
LIBQRENCODE_LIBS
MOWGLI_CFLAGS
MOWGLI_LIBS
PCRE_CFLAGS
Expand Down Expand Up @@ -1454,6 +1458,10 @@ Some influential environment variables:
C compiler flags for JANSSON, overriding pkg-config
JANSSON_LIBS
linker flags for JANSSON, overriding pkg-config
LIBQRENCODE_CFLAGS
C compiler flags for LIBQRENCODE, overriding pkg-config
LIBQRENCODE_LIBS
linker flags for LIBQRENCODE, overriding pkg-config
MOWGLI_CFLAGS
C compiler flags for MOWGLI, overriding pkg-config
MOWGLI_LIBS linker flags for MOWGLI, overriding pkg-config
Expand Down Expand Up @@ -6717,18 +6725,18 @@ else
/* end confdefs.h. */
/* For now, do not test the preprocessor; as of 2007 there are too many
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
/* Test literals. */
long long int ll = 9223372036854775807ll;
long long int nll = -9223372036854775807LL;
unsigned long long int ull = 18446744073709551615ULL;
/* Test constant expressions. */
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
? 1 : -1)];
? 1 : -1)];
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
? 1 : -1)];
? 1 : -1)];
int i = 63;
int
main ()
Expand All @@ -6737,9 +6745,9 @@ main ()
long long int llmax = 9223372036854775807ll;
unsigned long long int ullmax = 18446744073709551615ull;
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
;
return 0;
}
Expand Down Expand Up @@ -6914,33 +6922,33 @@ if ${ac_cv_type_long_long_int+:} false; then :
else
ac_cv_type_long_long_int=yes
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
if test $ac_cv_type_long_long_int = yes; then
if test "$cross_compiling" = yes; then :
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
if test $ac_cv_type_long_long_int = yes; then
if test "$cross_compiling" = yes; then :
:
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <limits.h>
#ifndef LLONG_MAX
# define HALF \
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
# define LLONG_MAX (HALF - 1 + HALF)
#endif
#ifndef LLONG_MAX
# define HALF \
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
# define LLONG_MAX (HALF - 1 + HALF)
#endif
int
main ()
{
long long int n = 1;
int i;
for (i = 0; ; i++)
{
long long int m = n << i;
if (m >> i != n)
return 1;
if (LLONG_MAX / 2 < m)
break;
}
return 0;
int i;
for (i = 0; ; i++)
{
long long int m = n << i;
if (m >> i != n)
return 1;
if (LLONG_MAX / 2 < m)
break;
}
return 0;
;
return 0;
}
Expand All @@ -6954,7 +6962,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
Expand All @@ -6977,18 +6985,18 @@ else
/* end confdefs.h. */
/* For now, do not test the preprocessor; as of 2007 there are too many
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
/* Test literals. */
long long int ll = 9223372036854775807ll;
long long int nll = -9223372036854775807LL;
unsigned long long int ull = 18446744073709551615ULL;
/* Test constant expressions. */
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
? 1 : -1)];
? 1 : -1)];
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
? 1 : -1)];
? 1 : -1)];
int i = 63;
int
main ()
Expand All @@ -6997,9 +7005,9 @@ main ()
long long int llmax = 9223372036854775807ll;
unsigned long long int ullmax = 18446744073709551615ull;
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
;
return 0;
}
Expand Down Expand Up @@ -9705,6 +9713,80 @@ $as_echo "#define HAVE_JSON /**/" >>confdefs.h
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBQRENCODE" >&5
$as_echo_n "checking for LIBQRENCODE... " >&6; }
if test -n "$LIBQRENCODE_CFLAGS"; then
pkg_cv_LIBQRENCODE_CFLAGS="$LIBQRENCODE_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libqrencode\""; } >&5
($PKG_CONFIG --exists --print-errors "libqrencode") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBQRENCODE_CFLAGS=`$PKG_CONFIG --cflags "libqrencode" 2>/dev/null`
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBQRENCODE_LIBS"; then
pkg_cv_LIBQRENCODE_LIBS="$LIBQRENCODE_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libqrencode\""; } >&5
($PKG_CONFIG --exists --print-errors "libqrencode") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBQRENCODE_LIBS=`$PKG_CONFIG --libs "libqrencode" 2>/dev/null`
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBQRENCODE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libqrencode" 2>&1`
else
LIBQRENCODE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libqrencode" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBQRENCODE_PKG_ERRORS" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
LIBQRENCODE="no"
elif test $pkg_failed = untried; then
LIBQRENCODE="no"
else
LIBQRENCODE_CFLAGS=$pkg_cv_LIBQRENCODE_CFLAGS
LIBQRENCODE_LIBS=$pkg_cv_LIBQRENCODE_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
LIBQRENCODE="yes"
fi
if test "$LIBQRENCODE" = "yes"; then
$as_echo "#define HAVE_LIBQRENCODE /**/" >>confdefs.h
fi
# Check whether --with-libmowgli was given.
if test "${with_libmowgli+set}" = set; then :
withval=$with_libmowgli;
Expand Down Expand Up @@ -11484,6 +11566,7 @@ Configuration:
PCRE support : ${with_pcre}
Perl support : ${with_perl}
JSON support : ${JSON}
QR Code support : ${LIBQRENCODE}
CFLAGS : ${CFLAGS}
Internationalization : ${USE_NLS}
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Expand Up @@ -359,6 +359,12 @@ if test "$JSON" = "yes"; then
AC_DEFINE(HAVE_JSON,, Define to 1 if JSON is available)
fi

PKG_CHECK_MODULES(LIBQRENCODE, [libqrencode], [LIBQRENCODE="yes"], [LIBQRENCODE="no"])

if test "$LIBQRENCODE" = "yes"; then
AC_DEFINE(HAVE_LIBQRENCODE,, Define to 1 if libqrencode is available)
fi

AC_ARG_WITH(libmowgli,
AC_HELP_STRING([--with-libmowgli@<:@=prefix@:>@],
[ Specify location of system libmowgli install, or "no" to force use of internal libmowgli]),
Expand Down Expand Up @@ -438,6 +444,7 @@ Configuration:
PCRE support : ${with_pcre}
Perl support : ${with_perl}
JSON support : ${JSON}
QR Code support : ${LIBQRENCODE}
CFLAGS : ${CFLAGS}
Internationalization : ${USE_NLS}

Expand Down
2 changes: 2 additions & 0 deletions extra.mk.in
Expand Up @@ -128,3 +128,5 @@ PERL_CFLAGS ?= @PERL_CFLAGS@
PERL_LIBS ?= @PERL_LIBS@
JANSSON_CFLAGS ?= @JANSSON_CFLAGS@
JANSSON_LIBS ?= @JANSSON_LIBS@
LIBQRENCODE_CFLAGS ?= @LIBQRENCODE_CFLAGS@
LIBQRENCODE_LIBS ?= @LIBQRENCODE_LIBS@
7 changes: 5 additions & 2 deletions include/sysconf.h.in
Expand Up @@ -59,6 +59,9 @@
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL

/* Define to 1 if libqrencode is available */
#undef HAVE_LIBQRENCODE

/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET

Expand All @@ -74,7 +77,7 @@
/* Define to 1 if the system has the type `long double'. */
#undef HAVE_LONG_DOUBLE

/* Define to 1 if the system has the type `long long int'. */
/* Define to 1 if the system has the type 'long long int'. */
#undef HAVE_LONG_LONG_INT

/* Define to 1 if you have the <memory.h> header file. */
Expand Down Expand Up @@ -149,7 +152,7 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* Define to 1 if the system has the type `unsigned long long int'. */
/* Define to 1 if the system has the type 'unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT

/* Define to 1 if you have the <varargs.h> header file. */
Expand Down

0 comments on commit 8197c48

Please sign in to comment.