Changeset 82149f4 for configure


Ignore:
Timestamp:
2023-03-04T19:59:09Z (21 months ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
50d0a72
Parents:
709f41f
git-author:
Petr Vaněk <arkamar@…> (04-03-23 19:59:09)
git-committer:
GitHub <noreply@…> (04-03-23 19:59:09)
Message:

Fixes related to external-json-parser (#165)

  • configure: append conditionally json-parser to pc file

json-parser needs to be appended to Requires section of pkg-config file
when bitlbee is configured to use external-json-parser. This change is
needed for external plugins like bitlbee-steam.

  • Makefile: do not install json.h when system json-parser is used

install-dev target should not install bundled json.h when bitlbee is
configured to use external-json-parser.

  • Use correct json.h header file with respect to external_json_parser value

The preprocessor must include correct json.h header file with respect to
external_json_parser value, otherwise function prototypes and other
definitions do not need to correspond with object used for linking.

The state before this commit is that local version lib/json.h is used
always for compilation and external_json_parser variable controls if
local lib/json.o or global libjsonparser.so will be linked.

In order to fix this problem, #include directives in lib/json_util.h and
lib/oauth2.c were changed from "json.h" to <json.h> and preprocessor -I
flags were moved after conditional json-parser flags, which is enough
for solving the issue. Additionally, USE_EXTERNAL_JSON_PARSER macro is
exported when external-json-parser is used and it is used in lib/json.h
to trigger an error message, which should prevent similar mistakes in
future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r709f41f r82149f4  
    330330
    331331echo "CFLAGS=$CFLAGS $CPPFLAGS" >> Makefile.settings
    332 echo CFLAGS+=-I"${srcdir}" -I"${srcdir}"/lib -I"${srcdir}"/protocols -I. >> Makefile.settings
    333332
    334333echo CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE >> Makefile.settings
     
    421420    # shellcheck disable=SC2129
    422421    echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings
     422    echo "CFLAGS+=-DUSE_EXTERNAL_JSON_PARSER" >> Makefile.settings
    423423    echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> Makefile.settings
    424424    echo "LDFLAGS_TESTS+=$(pkg-config --libs json-parser)" >> Makefile.settings
    425425fi
    426426
     427echo CFLAGS+=-I"${srcdir}" -I"${srcdir}"/lib -I"${srcdir}"/protocols -I. >> Makefile.settings
    427428
    428429detect_gnutls()
     
    868869esac
    869870
     871pkgconfigrequires='glib-2.0'
     872if [ "$external_json_parser" = '1' ]; then
     873        pkgconfigrequires="$pkgconfigrequires json-parser"
     874fi
     875
    870876cat <<EOF >bitlbee.pc
    871877prefix=$prefix
     
    877883Name: bitlbee
    878884Description: IRC to IM gateway
    879 Requires: glib-2.0
     885Requires: $pkgconfigrequires
    880886Version: $BITLBEE_VERSION
    881887Libs: $pkgconfiglibs
Note: See TracChangeset for help on using the changeset viewer.