[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating Debian packages, stumbled upon some problems



Greetings!

I've started creating Debian packages of ZXID (I noticed that the instructions
for installing these packages are already in place...), but found that
compilation wasn't completely straightforward. These are some hurdles I
found:

* CC?=gcc together with MAKEFLAGS= -rR in the Makefile doesn't work as
intended (at least not with GNU make; it seems that GNU make, when first
parsing variable assignments, sees that CC is defined (it has a built-in
default). Note that FOO ?= bar is exactly equivalent to

     ifeq ($(origin FOO), undefined)
       FOO = bar
     endif

so the conditional is skipped; *then* -R takes effect and GNU make promptly
forgets the built-in default value.

* Setting CDEF on the command line doesn't work as intended (again, at least
not with GNU make). A number of += assignments is essentially the same as a
single = assignment, and that assignment is overridden by the assignment on
the command line. Passing one's own CDEF as an environment variable instead
works, so it's not a big deal. There's also the localconf.mk option, but I
suggest keeping different variables for internal use and for additional defs
and includes provided at build time.

* ZXID_PATH and ZXID_CONF_PATH aren't stringified in the code, so CDEF='-
DZXID_CONF_PATH="/opt/zxid/zxid.conf"' doesn't work. One has to escape the
quotes so that they are explicitly included in the macro definitions. I guess
that's the way it has to be now.

* SAML_wrap.c fails to compile due to undefining bool:

> SAML_wrap.c: In function b_wrap_zxid_sp_slo_redirb:
> /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/handy.h:124:34: error: bboolb
> undeclared (first use in this function)
>
>  #define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)
>                                   ^
>
> /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/perl.h:3158:62: note: in
definition
> of macro bEXPECTb
>
>  #  define EXPECT(expr,val)                  __builtin_expect(expr,val)
>                                                               ^
>
> /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/perl.h:3163:52: note: in expansion
> of macro bcBOOLb
>
>  #define UNLIKELY(cond)                      EXPECT(cBOOL(cond),FALSE)
>                                                     ^
>
> /usr/lib/x86_64-linux-gnu/perl/5.20/CORE/pp.h:282:31: note: in expansion of
> macro bUNLIKELYb
>
>  # define EXTEND(p,n)   (void)(UNLIKELY(PL_stack_max - p < (SSize_t)(n)) &&
>     \
>                                ^
>
> SAML_wrap.c:43056:9: note: in expansion of macro bEXTENDb
>
>          EXTEND(sp,1);

* The zxidjava.jar target fails because LICENSE.curl is missing.

* libzxid.so.0.0 needs an SONAME, e.g. by adding -Wl,-soname=libzxid.so.0 to
the linking command. (It also needs the proper care not to break ABI
compatibility without changing the SONAME, of course). A symlink called simply
libzxid.so should be created so that all the binaries can be dynamically
linked with the library. Suggest something like this to simplify version
handling:

SHLIBLINK = libzxid.so
SONAME = $(SHLIBLINK).0
SHLIB = $(SONAME).0

and modifying targets and prerequisites accordingly. I'll get back with
details on how I intend to modify Makefile. $(SHARED) should preferably be
honoured.

* Are you sure that the install_nodep target installs header files in the
proper directories? Can't they all be installed in $(PREFIX)/include/zx? All
the .h files in c/ are included via that prefix, but are they necessary to
compile programs using libzxid? And all the others are included via "zx/".

I have only basic understanding of SAML, but I dare say that I know how to
create Debian packages and maintain libraries. :-)

--
Magnus Holmgren        holmgren@xxxxxxxxxx
Debian Developer

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]