Skip to content

Commit

Permalink
don't be too eager setting POCO_PREFIX to /usr/local; add --no-prefix…
Browse files Browse the repository at this point in the history
… option to configure to NOT set POCO_PREFIX; output POCO_LIB_INSTALLDIR if POCO_VERBOSE
  • Loading branch information
obiltschnig committed Mar 6, 2016
1 parent 0eaaa42 commit d3f1200
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 35 deletions.
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,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
Expand All @@ -42,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
Expand All @@ -57,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

Expand Down
17 changes: 10 additions & 7 deletions build/rules/global
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PROJECT_BASE = $(POCO_BASE)
endif
export PROJECT_BASE
ifdef POCO_VERBOSE
$(info PROJECT_BASE = $(PROJECT_BASE))
$(info PROJECT_BASE = $(PROJECT_BASE))
endif

#
Expand All @@ -46,7 +46,7 @@ POCO_BUILD = $(PROJECT_BASE)
endif
export POCO_BUILD
ifdef POCO_VERBOSE
$(info POCO_BUILD = $(POCO_BUILD))
$(info POCO_BUILD = $(POCO_BUILD))
endif

#
Expand Down Expand Up @@ -81,12 +81,12 @@ ifeq ($(findstring MINGW,$(POCO_HOST_OSNAME)),MINGW)
POCO_HOST_OSNAME = MinGW
endif
ifdef POCO_VERBOSE
$(info POCO_HOST_OSNAME= $(POCO_HOST_OSNAME))
$(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))
$(info POCO_HOST_OSARCH = $(POCO_HOST_OSARCH))
endif

#
Expand Down Expand Up @@ -124,7 +124,7 @@ ifndef POCO_CONFIG
POCO_CONFIG = $(POCO_HOST_OSNAME)
endif
ifdef POCO_VERBOSE
$(info POCO_CONFIG = $(POCO_CONFIG))
$(info POCO_CONFIG = $(POCO_CONFIG))
endif

#
Expand All @@ -141,7 +141,7 @@ else
OSNAME := $(POCO_TARGET_OSNAME)
endif
ifdef POCO_VERBOSE
$(info OSNAME = $(OSNAME))
$(info OSNAME = $(OSNAME))
endif

ifndef POCO_TARGET_OSARCH
Expand All @@ -150,7 +150,7 @@ else
OSARCH := $(POCO_TARGET_OSARCH)
endif
ifdef POCO_VERBOSE
$(info OSARCH = $(OSARCH))
$(info OSARCH = $(OSARCH))
endif

HOSTNAME := $(shell hostname)
Expand Down Expand Up @@ -221,6 +221,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 =
Expand Down
20 changes: 17 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Options:
--prefix=<install_prefix>
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
Expand Down Expand Up @@ -134,6 +138,7 @@ cd $build

tests=1
samples=1
noprefix=0
flags=""
includepath=""
librarypath=""
Expand All @@ -153,6 +158,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)}'`" ;;
Expand Down Expand Up @@ -259,7 +267,9 @@ if [ ! -f "$base/build/config/$config" ] ; then
fi

if [ -z "$prefix" ] ; then
prefix=/usr/local
if [ $noprefix -eq 0 ] ; then
prefix=/usr/local
fi
fi

# check for patches
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions release/script/mkdoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ mkdir -p $tools
mkrelease -o $tools $version CppParser PocoDoc

cd $tools
./configure --no-tests --no-samples
make -s -j8
./configure --no-tests --no-samples --no-prefix
make -s -j8

if [ $osname = "CYGWIN" ] ; then
find $tools -type f -name "*.$libversion.dll" > $TMP/dlls
Expand Down
21 changes: 7 additions & 14 deletions release/script/mkrelease
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,14 @@ $(warning WARNING: POCO_BASE is not defined. Assuming current directory.)
export POCO_BASE=$(shell pwd)
endif
ifdef POCO_VERBOSE
$(info POCO_BASE = $(POCO_BASE))
endif
ifndef POCO_PREFIX
export POCO_PREFIX=/usr/local
endif
ifdef POCO_VERBOSE
$(info POCO_PREFIX=$(POCO_PREFIX))
$(info POCO_BASE = $(POCO_BASE))
endif
ifndef POCO_BUILD
export POCO_BUILD=$(POCO_BASE)
endif
ifdef POCO_VERBOSE
$(info POCO_BUILD = $(POCO_BUILD))
$(info POCO_BUILD = $(POCO_BUILD))
endif
#
Expand All @@ -239,12 +232,12 @@ ifeq ($(findstring MINGW,$(POCO_HOST_OSNAME)),MINGW)
POCO_HOST_OSNAME = MinGW
endif
ifdef POCO_VERBOSE
$(info POCO_HOST_OSNAME= $(POCO_HOST_OSNAME))
$(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))
$(info POCO_HOST_OSARCH = $(POCO_HOST_OSARCH))
endif
#
Expand All @@ -254,7 +247,7 @@ ifndef POCO_CONFIG
POCO_CONFIG = $(POCO_HOST_OSNAME)
endif
ifdef POCO_VERBOSE
$(info POCO_CONFIG = $(POCO_CONFIG))
$(info POCO_CONFIG = $(POCO_CONFIG))
endif
#
Expand All @@ -271,7 +264,7 @@ else
OSNAME := $(POCO_TARGET_OSNAME)
endif
ifdef POCO_VERBOSE
$(info OSNAME = $(OSNAME))
$(info OSNAME = $(OSNAME))
endif
ifndef POCO_TARGET_OSARCH
Expand All @@ -280,7 +273,7 @@ else
OSARCH := $(POCO_TARGET_OSARCH)
endif
ifdef POCO_VERBOSE
$(info OSARCH = $(OSARCH))
$(info OSARCH = $(OSARCH))
endif
.PHONY: poco all libexecs cppunit tests samples cleans clean distclean install
Expand Down

0 comments on commit d3f1200

Please sign in to comment.