don't be too eager setting POCO_PREFIX to /usr/local; add --no-prefix option to configure to NOT set POCO_PREFIX; output POCO_LIB_INSTALLDIR if POCO_VERBOSE

This commit is contained in:
Guenter Obiltschnig 2016-03-06 11:25:50 +01:00
parent 560adf6f0a
commit 3a759171d7
5 changed files with 81 additions and 23 deletions

View File

@ -11,14 +11,16 @@ ifndef POCO_BASE
$(warning WARNING: POCO_BASE is not defined. Assuming current directory.)
export POCO_BASE=$(shell pwd)
endif
ifndef POCO_PREFIX
export POCO_PREFIX=/usr/local
ifdef POCO_VERBOSE
$(info POCO_BASE = $(POCO_BASE))
endif
ifndef POCO_BUILD
export POCO_BUILD=$(POCO_BASE)
endif
ifdef POCO_VERBOSE
$(info POCO_BUILD = $(POCO_BUILD))
endif
#
# Determine OS
@ -39,7 +41,9 @@ POCO_HOST_OSARCH ?= $(subst /,-,$(shell uname -m | tr ' ' _))
ifndef POCO_CONFIG
POCO_CONFIG = $(POCO_HOST_OSNAME)
endif
#$(info POCO_CONFIG = $(POCO_CONFIG))
ifdef POCO_VERBOSE
$(info POCO_CONFIG = $(POCO_CONFIG))
endif
#
# Include System Specific Settings
@ -54,14 +58,18 @@ OSNAME := $(POCO_HOST_OSNAME)
else
OSNAME := $(POCO_TARGET_OSNAME)
endif
#$(info OSNAME = $(OSNAME))
ifdef POCO_VERBOSE
$(info OSNAME = $(OSNAME))
endif
ifndef POCO_TARGET_OSARCH
OSARCH := $(POCO_HOST_OSARCH)
else
OSARCH := $(POCO_TARGET_OSARCH)
endif
#$(info OSARCH = $(OSARCH))
ifdef POCO_VERBOSE
$(info OSARCH = $(OSARCH))
endif
.PHONY: poco all libexecs cppunit tests samples cleans clean distclean install
@ -76,7 +84,7 @@ cppunit:
$(MAKE) -C $(POCO_BASE)/CppUnit
CppUnit-clean:
\$(MAKE) -C \$(POCO_BASE)/CppUnit clean
$(MAKE) -C $(POCO_BASE)/CppUnit clean
install: libexecs
mkdir -p $(INSTALLDIR)/include/Poco

View File

@ -25,7 +25,7 @@ endif
#
# Include some optional make configuration
#
sinclude $(POCO_BASE)/config.make
sinclude $(POCO_BASE)/config.build
#
# Check for PROJECT_BASE
@ -34,6 +34,9 @@ ifndef PROJECT_BASE
PROJECT_BASE = $(POCO_BASE)
endif
export PROJECT_BASE
ifdef POCO_VERBOSE
$(info PROJECT_BASE = $(PROJECT_BASE))
endif
#
# Check for POCO_BUILD
@ -42,6 +45,9 @@ ifndef POCO_BUILD
POCO_BUILD = $(PROJECT_BASE)
endif
export POCO_BUILD
ifdef POCO_VERBOSE
$(info POCO_BUILD = $(POCO_BUILD))
endif
#
# POCO_BASE/POCO_BUILD/cwd sanity checks
@ -77,7 +83,14 @@ endif
ifeq ($(findstring MINGW,$(POCO_HOST_OSNAME)),MINGW)
POCO_HOST_OSNAME = MinGW
endif
ifdef POCO_VERBOSE
$(info POCO_HOST_OSNAME = $(POCO_HOST_OSNAME))
endif
POCO_HOST_OSARCH ?= $(subst /,-,$(shell uname -m | tr ' ' _))
ifdef POCO_VERBOSE
$(info POCO_HOST_OSARCH = $(POCO_HOST_OSARCH))
endif
#
# Begin Sun platforms
@ -113,6 +126,9 @@ endif
ifndef POCO_CONFIG
POCO_CONFIG = $(POCO_HOST_OSNAME)
endif
ifdef POCO_VERBOSE
$(info POCO_CONFIG = $(POCO_CONFIG))
endif
#
# Include System Specific Settings
@ -127,11 +143,19 @@ OSNAME := $(POCO_HOST_OSNAME)
else
OSNAME := $(POCO_TARGET_OSNAME)
endif
ifdef POCO_VERBOSE
$(info OSNAME = $(OSNAME))
endif
ifndef POCO_TARGET_OSARCH
OSARCH := $(subst /,-,$(shell uname -m | tr ' ' _))
else
OSARCH := $(POCO_TARGET_OSARCH)
endif
ifdef POCO_VERBOSE
$(info OSARCH = $(OSARCH))
endif
HOSTNAME := $(shell hostname)
#
@ -200,6 +224,9 @@ POCO_LIB_INSTALLDIR = $(POCO_PREFIX)/lib
else
POCO_LIB_INSTALLDIR = $(LIBPATH)
endif
ifdef POCO_VERBOSE
$(info POCO_LIB_INSTALLDIR = $(POCO_LIB_INSTALLDIR))
endif
ifeq ($(POCO_BASE),$(PROJECT_BASE))
POCO_LIBRARY =

18
configure vendored
View File

@ -29,6 +29,10 @@ Options:
Use the given install directory for make install.
Default is /usr/local.
--no-prefix
Do not use /usr/local as default install directory and do not
define POCO_PREFIX.
--stdcxx-base=<apache_stdcxx_install_prefix>
If (and only if) the $base/build/config selected with --config
uses the Apache stdcxx library, then apache_stdcxx_install_prefix
@ -134,6 +138,7 @@ cd $build
tests=1
samples=1
noprefix=0
flags=""
includepath=""
librarypath=""
@ -154,6 +159,9 @@ while [ $# -ge 1 ]; do
--prefix=*)
prefix="`echo ${1} | awk '{print substr($0,10)}'`" ;;
--no-prefix)
noprefix=1 ;;
--stdcxx-base=*)
stdcxx_base="`echo ${1} | awk '{print substr($0,15)}'`" ;;
@ -259,8 +267,10 @@ if [ ! -f "$base/build/config/$config" ] ; then
fi
if [ -z "$prefix" ] ; then
if [ $noprefix -eq 0 ] ; then
prefix=/usr/local
fi
fi
# check for patches
if [ -d $base/patches/$config ] ; then
@ -287,8 +297,10 @@ echo '# config.make generated by configure script' >$build/config.make
echo "POCO_CONFIG = $config" >>$build/config.make
echo "POCO_BASE = $base" >>$build/config.make
echo "POCO_BUILD = $build" >>$build/config.make
echo "POCO_PREFIX = $prefix" >>$build/config.make
echo "POCO_FLAGS = $flags" >>$build/config.make
if [ -n "$prefix" ] ; then
echo "POCO_PREFIX = $prefix" >>$build/config.make
fi
echo "OMIT = $omit" >>$build/config.make
if [ -n "$stdcxx_base" ] ; then
echo "STDCXX_BASE = $stdcxx_base" >>$build/config.make
@ -316,10 +328,12 @@ cat <<__EOF__ >>$build/config.make
export POCO_CONFIG
export POCO_BASE
export POCO_BUILD
export POCO_PREFIX
export POCO_FLAGS
__EOF__
if [ -n "$prefix" ] ; then
echo "export POCO_PREFIX" >>$build/config.make
fi
if [ -n "$stdcxx_base" ] ; then
echo "export STDCXX_BASE" >>$build/config.make
fi

View File

@ -91,7 +91,7 @@ mkdir -p $tools
mkrelease -o $tools $version CppParser PocoDoc
cd $tools
./configure --no-tests --no-samples
./configure --no-tests --no-samples --no-prefix
make -s -j8
if [ $osname = "Cygwin" ] ; then

View File

@ -209,17 +209,16 @@ ifndef POCO_BASE
$(warning WARNING: POCO_BASE is not defined. Assuming current directory.)
export POCO_BASE=$(shell pwd)
endif
#$(info POCO_BASE = $(POCO_BASE))
ifndef POCO_PREFIX
export POCO_PREFIX=/usr/local
ifdef POCO_VERBOSE
$(info POCO_BASE = $(POCO_BASE))
endif
#$(info POCO_PREFIX=$(POCO_PREFIX))
ifndef POCO_BUILD
export POCO_BUILD=$(POCO_BASE)
endif
#$(info POCO_BUILD = $(POCO_BUILD))
ifdef POCO_VERBOSE
$(info POCO_BUILD = $(POCO_BUILD))
endif
#
# Determine OS
@ -232,10 +231,14 @@ endif
ifeq ($(findstring MINGW,$(POCO_HOST_OSNAME)),MINGW)
POCO_HOST_OSNAME = MinGW
endif
#$(info POCO_HOST_OSNAME= $(POCO_HOST_OSNAME))
ifdef POCO_VERBOSE
$(info POCO_HOST_OSNAME = $(POCO_HOST_OSNAME))
endif
POCO_HOST_OSARCH ?= $(subst /,-,$(shell uname -m | tr ' ' _))
#$(info POCO_HOST_OSARCH= $(POCO_HOST_OSARCH))
ifdef POCO_VERBOSE
$(info POCO_HOST_OSARCH = $(POCO_HOST_OSARCH))
endif
#
# If POCO_CONFIG is not set, use the OS name as configuration name
@ -243,7 +246,9 @@ POCO_HOST_OSARCH ?= $(subst /,-,$(shell uname -m | tr ' ' _))
ifndef POCO_CONFIG
POCO_CONFIG = $(POCO_HOST_OSNAME)
endif
#$(info POCO_CONFIG = $(POCO_CONFIG))
ifdef POCO_VERBOSE
$(info POCO_CONFIG = $(POCO_CONFIG))
endif
#
# Include System Specific Settings
@ -258,14 +263,18 @@ OSNAME := $(POCO_HOST_OSNAME)
else
OSNAME := $(POCO_TARGET_OSNAME)
endif
#$(info OSNAME = $(OSNAME))
ifdef POCO_VERBOSE
$(info OSNAME = $(OSNAME))
endif
ifndef POCO_TARGET_OSARCH
OSARCH := $(POCO_HOST_OSARCH)
else
OSARCH := $(POCO_TARGET_OSARCH)
endif
#$(info OSARCH = $(OSARCH))
ifdef POCO_VERBOSE
$(info OSARCH = $(OSARCH))
endif
.PHONY: poco all libexecs cppunit tests samples cleans clean distclean install
@ -284,7 +293,7 @@ cppunit:
$(MAKE) -C $(POCO_BASE)/CppUnit
CppUnit-clean:
\$(MAKE) -C \$(POCO_BASE)/CppUnit clean
$(MAKE) -C \$(POCO_BASE)/CppUnit clean
install: libexecs
mkdir -p $(INSTALLDIR)/include/Poco