summaryrefslogtreecommitdiff
path: root/libcurl/README-DEV
blob: d4e099d8d6e884308552950c6ea48e547b318467 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
This document describes how libcurl was packaged for build2. In particular,
this understanding will be useful when upgrading to a new upstream version.
See ../README-DEV for general notes on curl packaging.

Symlink the required upstream directories into libcurl/:

$ ln -s ../../upstream/{lib,include} libcurl

Create libcurl/curl_config.h using as a base the upstream's auto-generated
header and/or the corresponding .m4 and configure.ac files.

Some macro values cannot be easily determined at the preprocessing time. We
define them based on the supported platform tests and add libcurl/assert.c,
containing compile-time assertions for the macros in question.

Note that re-creating libcurl/curl_config.h from scratch every time we upgrade
to a new upstream version would be a real pain. Instead we can only (un)define
the newly introduced macros, comparing the already defined and currently used
macro sets. For the comparison we can use config-*.h and auto-generated on
Linux upstream's curl_config.h:

$ for m in `cat <upstream-build-dir>/lib/curl_config.h libcurl/lib/config-*.h | \
            sed -n 's/^.*#\s*\(define\|undef\)\s\{1,\}\([_A-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\2/p' | \
            sort -u`; do
    if grep -q -e "\b$m\b" `find -L . ../curl -name '*.h' -a ! -name curl_config.h -a ! -name 'config-*.h' -o -name '*.c'`; then
      echo "$m"
    fi
  done >used-macros

$ cat libcurl/curl_config.h | \
  sed -n 's/^.*#\s*\(define\|undef\)\s\{1,\}\([_A-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\2/p' | \
  sort -u >defined-macros

$ diff defined-macros used-macros | grep '<' >remove-macros
$ diff defined-macros used-macros | grep '>' >add-macros