Added "--with-external-libfetch" to build against external libfetch.

This commit is contained in:
Juan RP 2011-01-12 17:06:53 +01:00
parent cb8464bdc6
commit 2206b27037
2 changed files with 33 additions and 12 deletions

40
configure vendored
View File

@ -12,6 +12,7 @@ DEBUG=
BUILD_API_DOCS= BUILD_API_DOCS=
BUILD_PIE= BUILD_PIE=
EXTERNAL_PROPLIB= EXTERNAL_PROPLIB=
EXTERNAL_LIBFETCH=
usage() usage()
{ {
@ -23,17 +24,18 @@ By default, \`make install' will install all the files in
an installation prefix other than \`/usr/local' using \`--prefix', an installation prefix other than \`/usr/local' using \`--prefix',
for instance \`--prefix=\$HOME'. for instance \`--prefix=\$HOME'.
--prefix=DIR install architecture-independent files in PREFIX --prefix=DIR install architecture-independent files in PREFIX
--sbindir=DIR system admin executables [PREFIX/sbin] --sbindir=DIR system admin executables [PREFIX/sbin]
--libdir=DIR object code libraries [PREFIX/lib] --libdir=DIR object code libraries [PREFIX/lib]
--includedir=DIR C header files [PREFIX/include] --includedir=DIR C header files [PREFIX/include]
--mandir=DIR man documentation [PREFIX/share/man] --mandir=DIR man documentation [PREFIX/share/man]
--datadir=DIR read-only architecture-independent data [PREFIX/share] --datadir=DIR read-only architecture-independent data [PREFIX/share]
--debug Build with debugging code and symbols --debug Build with debugging code and symbols
--with-pie Build XBPS programs as PIE (default disabled) --with-pie Build XBPS programs as PIE (default disabled)
--with-api-docs install XBPS API Library documentation (default disabled) --with-api-docs install XBPS API Library documentation (default disabled)
--with-external-proplib Use external proplib [default disabled] --with-external-proplib Use external proplib [default disabled]
--with-external-libfetch Use external libfetch [default disabled]
_EOF _EOF
exit 1 exit 1
@ -57,6 +59,7 @@ for x; do
--with-api-docs) BUILD_API_DOCS=$var;; --with-api-docs) BUILD_API_DOCS=$var;;
--with-pie) BUILD_PIE=$var;; --with-pie) BUILD_PIE=$var;;
--with-external-proplib) EXTERNAL_PROPLIB=$var;; --with-external-proplib) EXTERNAL_PROPLIB=$var;;
--with-external-libfetch) EXTERNAL_LIBFETCH=$var;;
--help) usage;; --help) usage;;
*) echo "$0: WARNING: unknown option $opt" >&2;; *) echo "$0: WARNING: unknown option $opt" >&2;;
esac esac
@ -198,6 +201,18 @@ else
echo "STATIC_PROPLIB = -lprop" >> $CONFIG_MK echo "STATIC_PROPLIB = -lprop" >> $CONFIG_MK
fi fi
#
# Check if external libfetch should be used.
#
if [ -z "$EXTERNAL_LIBFETCH" ]; then
EXTERNAL_LIBFETCH_VALUE=no
echo "CPPFLAGS += -I\$(TOPDIR)/lib/fetch" >>$CONFIG_MK
else
EXTERNAL_LIBFETCH_VALUE=yes
echo "USE_EXTERNAL_LIBFETCH = 1" >>$CONFIG_MK
echo "LDFLAGS += -lfetch" >>$CONFIG_MK
echo "STATIC_FETCH = -lfetch" >>$CONFIG_MK
fi
# Add CPPFLAGS and CFLAGS to CC for testing features # Add CPPFLAGS and CFLAGS to CC for testing features
XCC="$CC `$SED -n -e 's/CPPLAGS+=*\(.*\)/\1/p' $CONFIG_MK`" XCC="$CC `$SED -n -e 's/CPPLAGS+=*\(.*\)/\1/p' $CONFIG_MK`"
@ -245,7 +260,7 @@ EOF
for f in all extra error shadow "format=2" missing-prototypes \ for f in all extra error shadow "format=2" missing-prototypes \
missing-declarations nested-externs \ missing-declarations nested-externs \
cast-align cast-qual pointer-arith comment unused-macros \ cast-align cast-qual pointer-arith comment unused-macros \
declaration-after-statement stack-protector; do declaration-after-statement stack-protector "l,--as-needed"; do
check_compiler_flag ${f} W check_compiler_flag ${f} W
done done
@ -379,7 +394,7 @@ else
echo "found version $($PKGCONFIG_BIN --modversion zlib)." echo "found version $($PKGCONFIG_BIN --modversion zlib)."
fi fi
echo "STATIC_LIBS = -lz \$(STATIC_PROPLIB) -lpthread" >>$CONFIG_MK echo "STATIC_LIBS = -lz \$(STATIC_PROPLIB) \$(STATIC_FETCH) -lpthread" >>$CONFIG_MK
# #
# OpenSSL libssl with pkg-config support is required. # OpenSSL libssl with pkg-config support is required.
@ -419,6 +434,7 @@ echo " BUILD_API_DOCS = $BUILD_API_DOCS_VALUE"
echo " BUILD_PIE = $BUILD_PIE_VAL" echo " BUILD_PIE = $BUILD_PIE_VAL"
echo " DEBUG = $DEBUG" echo " DEBUG = $DEBUG"
echo " EXTERNAL PROPLIB = $EXTERNAL_PROPLIB_VALUE" echo " EXTERNAL PROPLIB = $EXTERNAL_PROPLIB_VALUE"
echo " EXTERNAL_LIBFETCH = $EXTERNAL_LIBFETCH_VALUE"
echo " CFLAGS = $CFLAGS" echo " CFLAGS = $CFLAGS"
echo " LDFLAGS = $LDFLAGS" echo " LDFLAGS = $LDFLAGS"
echo echo

View File

@ -31,6 +31,11 @@ LIBFETCH_SHLIBCFLAGS = -fvisibility=hidden
LIBFETCH_INCS = fetch/common.h LIBFETCH_INCS = fetch/common.h
LIBFETCH_GEN = fetch/ftperr.h fetch/httperr.h LIBFETCH_GEN = fetch/ftperr.h fetch/httperr.h
ifdef USE_EXTERNAL_LIBFETCH
LIBFETCH_OBJS =
LDFLAGS += -lfetch
endif
# libxbps # libxbps
OBJS = package_configure.o package_config_files.o package_orphans.o OBJS = package_configure.o package_config_files.o package_orphans.o
OBJS += package_remove.o package_remove_obsoletes.o package_state.o OBJS += package_remove.o package_remove_obsoletes.o package_state.o