Changeset 82149f4 for Makefile


Ignore:
Timestamp:
2023-03-04T19:59:09Z (22 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
  • Makefile

    r709f41f r82149f4  
    1111# Program variables
    1212objects = bitlbee.o dcc.o help.o ipc.o irc.o irc_im.o irc_cap.o irc_channel.o irc_commands.o irc_send.o irc_user.o irc_util.o nick.o $(OTR_BI) query.o root_commands.o set.o storage.o $(STORAGE_OBJS) auth.o $(AUTH_OBJS) unix.o conf.o log.o
    13 headers = $(wildcard $(_SRCDIR_)*.h $(_SRCDIR_)lib/*.h $(_SRCDIR_)protocols/*.h)
     13allheaders = $(wildcard $(_SRCDIR_)*.h $(_SRCDIR_)lib/*.h $(_SRCDIR_)protocols/*.h)
     14ifeq ($(EXTERNAL_JSON_PARSER),1)
     15headers = $(filter-out $(_SRCDIR_)lib/json.h,$(allheaders))
     16else
     17headers = $(allheaders)
     18endif
    1419subdirs = lib protocols
    1520
Note: See TracChangeset for help on using the changeset viewer.