Compiling and linking on Unix.

Home Download News Documentation FAQ Tutorial API reference Examples XML Digital Signature Online Verifier XML Encryption XML Canonicalization Reporting Bugs Mailing list Related
XML Security Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>
- # Compiling and linking on Unix. There are several ways to get necessary compilation and linking information on Unix: PKG_CHECK_MODULES() macro Example 2. Using PKG_CHECK_MODULES() macro in a configure.in file.
      dnl
      dnl Check for xmlsec and friends
      dnl
      PKG_CHECK_MODULES(XMLSEC, xmlsec1 >= 1.0.0 xml2 libxslt,,exit)
      CFLAGS="$CFLAGS $XMLSEC_CFLAGS"
      CPPFLAGS="$CPPFLAGS $XMLSEC_CFLAGS"
      LDFLAGS="$LDFLAGS $XMLSEC_LIBS"
- pkg-config script Example 3. Using pkg-config script in a Makefile.
      PROGRAM = test
      PROGRAM_FILES = test.c

      CFLAGS	+= -g $(shell pkg-config --cflags xmlsec1)
      LDFLAGS	+= -g
      LIBS 	+= $(shell pkg-config --libs xmlsec1)

      all: $(PROGRAM)

      %: %.c
      	$(cc) $(PROGRAM_FILES) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(LIBS)

      clean:
      	@rm -rf $(PROGRAM)
- xmlsec1-config script Example 4. Using xmlsec1-config script in a Makefile.
      PROGRAM = test
      PROGRAM_FILES = test.c

      CFLAGS	+= -g $(shell xmlsec1-config --cflags)
      LDFLAGS	+= -g
      LIBS 	+= $(shell xmlsec1-config --libs)

      all: $(PROGRAM)

      %: %.c
      	$(cc) $(PROGRAM_FILES) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(LIBS)

      clean:
      	@rm -rf $(PROGRAM)
<<< Previous Page | Home | Up | Next Page >>>
Include files | Compiling and linking on Windows.
Aleksey Sanin