diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6316f2e02f..3d780d527e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,31 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-19 20:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * mpkg_tgz.sh + * bin/postinst.sh + % Attempt to clean mpkg_tgz.sh from redundant make logic. + Some tasks (stripping, shared tool making using HB_BUILD_SHARED, + chmod on HB_INC_INSTALL) moved to postinst.sh, some others + deleted (platform detection, shared tool building using old + method, component detections, install dir forming and creation. + ; Please review me and test. + ; TODO: Maybe above tasks in postinst.sh should only be + executed when HB_BUILD_PKG=yes. + + * config/global.mk + ! Fixed to only use lib64 dir if it exists. Please review/test + this feature. + + Now exports HB_SYSLOC variable which is set to non-empty if + HB_INSTALL_PREFIX points to system location. + + * harbour.spec + - Deleted PIC option related lines. These are handled by GNU Make now. + + * utils/hbmk2/hbmk2.prg + + Added PIC related options to *nix compilers when using -hbdyn option. + % Deleted PIC related option from link command. Not needed. + 2009-09-19 18:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * config/global.mk diff --git a/harbour/bin/postinst.sh b/harbour/bin/postinst.sh index d8f51e9580..a18ae00686 100755 --- a/harbour/bin/postinst.sh +++ b/harbour/bin/postinst.sh @@ -40,6 +40,29 @@ fi . ${hb_root}/bin/hb-func.sh +# Keep the size of the binaries to a minimim. +if [ -f $HB_BIN_INSTALL/harbour${hb_exesuf} ]; then + ${HB_CCPREFIX}strip $HB_BIN_INSTALL/harbour${hb_exesuf} +fi +if [ "$HB_PLATFORM" != "hpux" ]; then + # Keep the size of the libraries to a minimim, but don't try to strip symlinks. + ${HB_CCPREFIX}strip -S `find $HB_LIB_INSTALL -type f` +fi + +# check if we should rebuild tools with shared libs +if [ "${HB_SYSLOC}" = yes ] +then + for utl in hbmk2 hbrun hbi18n hbformat hbtest + do + (cd "utils/${utl}" + rm -fR "./${HB_PLATFORM}/${HB_COMPILER}/${utl}${hb_exesuf}" + $MAKE install HB_BUILD_SHARED=yes + ${HB_CCPREFIX}strip "${HB_BIN_INSTALL}/${utl}${hb_exesuf}") + done +fi + +chmod 644 $HB_INC_INSTALL/* + if [ "$HB_COMPILER" = "gcc" ] || \ [ "$HB_COMPILER" = "mingw" ] || \ [ "$HB_COMPILER" = "mingw64" ] || \ diff --git a/harbour/config/global.mk b/harbour/config/global.mk index b15a1e6349..e2aa65215e 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1196,16 +1196,22 @@ ifeq ($(HB_INIT_DONE),) endif endif +HB_SYSLOC := +ifneq ($(findstring |/usr/local/bin,|$(HB_INSTALL_PREFIX)),) + HB_SYSLOC := yes +else ifneq ($(findstring |/usr/bin,|$(HB_INSTALL_PREFIX)),) + HB_SYSLOC := yes +else ifneq ($(findstring |/opt/harbour,|$(HB_INSTALL_PREFIX)),) + HB_SYSLOC := yes +else ifneq ($(findstring |/opt/bin,|$(HB_INSTALL_PREFIX)),) + HB_SYSLOC := yes +endif +export HB_SYSLOC + ifneq ($(HB_INSTALL_PREFIX),) ifeq ($(HB_BUILD_SHARED),) - ifneq ($(findstring |/usr/local/bin,|$(HB_INSTALL_PREFIX)),) - export HB_BUILD_SHARED := yes - else ifneq ($(findstring |/usr/bin,|$(HB_INSTALL_PREFIX)),) - export HB_BUILD_SHARED := yes - else ifneq ($(findstring |/opt/harbour,|$(HB_INSTALL_PREFIX)),) - export HB_BUILD_SHARED := yes - else ifneq ($(findstring |/opt/bin,|$(HB_INSTALL_PREFIX)),) + ifeq ($(HB_SYSLOC),yes) export HB_BUILD_SHARED := yes endif endif @@ -1228,9 +1234,11 @@ ifneq ($(HB_INSTALL_PREFIX),) INCPOSTFIX := $(DIRSEP)harbour endif endif - # Use 'lib64' instead of 'lib' for 64-bit targets - ifneq ($(filter $(HB_CPU),x86_64),) - LIBPOSTFIX := 64$(LIBPOSTFIX) + # Use 'lib64' instead of 'lib' for 64-bit targets where lib64 dir exists + ifneq ($(wildcard $(HB_INSTALL_PREFIX)$(DIRSEP)lib64),) + ifneq ($(filter $(HB_CPU),x86_64),) + LIBPOSTFIX := 64$(LIBPOSTFIX) + endif endif endif diff --git a/harbour/harbour.spec b/harbour/harbour.spec index 22d2ea0269..4053ab24f6 100644 --- a/harbour/harbour.spec +++ b/harbour/harbour.spec @@ -379,11 +379,6 @@ rm -rf $RPM_BUILD_ROOT %build %{hb_env} -case "`uname -m`" in - *[_@]64) - export HB_USER_CFLAGS="$HB_USER_CFLAGS -fPIC" - ;; -esac make %{?_smp_mflags} @@ -396,11 +391,6 @@ make %{?_smp_mflags} # Install harbour itself. %{hb_env} -case "`uname -m`" in - *[_@]64) - export HB_USER_CFLAGS="$HB_USER_CFLAGS -fPIC" - ;; -esac export _DEFAULT_BIN_DIR=$HB_BIN_INSTALL export _DEFAULT_INC_DIR=$HB_INC_INSTALL diff --git a/harbour/mpkg_tgz.sh b/harbour/mpkg_tgz.sh index 763e3a435d..c0bbfbfc5d 100755 --- a/harbour/mpkg_tgz.sh +++ b/harbour/mpkg_tgz.sh @@ -24,11 +24,8 @@ hb_platform=`get_hbplatform` hb_archfile="${name}-${hb_ver}${hb_platform}.bin.tar.gz" # disabled self extracting shell envelop hb_instfile="${name}-${hb_ver}${hb_platform}.inst.sh" -hb_lnkso="yes" hb_pref="hb" -hb_contrib="" hb_sysdir="yes" -hb_exesuf="" [ -z "$HB_INSTALL_PREFIX" ] && [ -n "$PREFIX" ] && export HB_INSTALL_PREFIX="$PREFIX" @@ -50,35 +47,8 @@ if [ -z "$HB_PLATFORM" ]; then export HB_PLATFORM="$hb_plat" fi -if [ -z "$HB_COMPILER" ]; then - case "$HB_PLATFORM" in - win) HB_COMPILER="mingw" ;; - dos) HB_COMPILER="djgpp" ;; - *) HB_COMPILER="gcc" ;; - esac - export HB_COMPILER -fi - -if [ -z "$HB_COMMERCE" ]; then export HB_COMMERCE=no; fi - -# default lib dir name -HB_LIBDIRNAME="lib" - ETC="/etc" -HB_ARCH64="" -if [ "$HB_PLATFORM" = "linux" ] -then - HB_CPU=`uname -m` - case "$HB_CPU" in - *[_@]64) - HB_ARCH64="yes" - ;; - *) - ;; - esac -fi - # Select the platform-specific installation prefix and ownership HB_INSTALL_OWNER=root case "$HB_PLATFORM" in @@ -86,31 +56,25 @@ case "$HB_PLATFORM" in [ -z "$HB_INSTALL_PREFIX" ] && HB_INSTALL_PREFIX="/usr/local" HB_INSTALL_GROUP=wheel ETC="/private/etc" - hb_lnkso="no" ;; linux) [ -z "$HB_INSTALL_PREFIX" ] && HB_INSTALL_PREFIX="/usr" - [ -d "$HB_INSTALL_PREFIX/lib64" ] && [ "${HB_ARCH64}" = yes ] && HB_LIBDIRNAME="lib64" HB_INSTALL_GROUP=root ;; sunos) [ -z "$HB_INSTALL_PREFIX" ] && HB_INSTALL_PREFIX="/usr" - [ -d "$HB_INSTALL_PREFIX/lib64" ] && [ "${HB_ARCH64}" = yes ] && HB_LIBDIRNAME="lib64" HB_INSTALL_GROUP=root ;; win) [ -z "$HB_INSTALL_PREFIX" ] && HB_INSTALL_PREFIX="/usr/local" HB_INSTALL_GROUP=0 hb_sysdir="no" - hb_exesuf=".exe" hb_instfile="" ;; dos) [ -z "$HB_INSTALL_PREFIX" ] && HB_INSTALL_PREFIX="/${name}" HB_INSTALL_GROUP=root - hb_lnkso="no" hb_sysdir="no" - hb_exesuf=".exe" hb_instfile="" hb_archfile="${name}.tgz" HB_INST_PREF="$TMPDIR/hb-$$" @@ -137,110 +101,21 @@ elif ! make --version >/dev/null 2>&1; then echo "Warning!!! Cannot find GNU MAKE" fi -# Set other platform-specific build options -if [ -z "$HB_INC_GPM" ]; then - if [ "$HB_PLATFORM" = "linux" ] && \ - ( [ -f /usr/include/gpm.h ] || [ -f /usr/local/include/gpm.h ]); then - HB_INC_GPM=yes - else - HB_INC_GPM=no - fi - export HB_INC_GPM -fi - -if [ -z "${HB_INC_SLANG}" ]; then - HB_INC_SLANG=yes - case "$HB_PLATFORM" in - linux|bsd|darwin|hpux|sunos) - for dir in /usr /usr/local /sw /opt/local - do - if [ -f ${dir}/include/slang.h ] || \ - [ -f ${dir}/include/slang/slang.h ]; then - HB_INC_SLANG=no - fi - done - ;; - esac - export HB_INC_SLANG -fi - -case "$HB_PLATFORM" in - linux) - ;; - darwin) - [ -z "$HB_INC_X11" ] && export HB_INC_X11=no - ;; - dos|win) - [ -z "$HB_INC_X11" ] && export HB_INC_X11=no - ;; - *) - [ -z "$HB_INC_X11" ] && export HB_INC_X11=no - ;; -esac - -if [ "$HB_COMMERCE" = yes ] -then - export HB_INC_GPM=no - export HB_INC_SLANG=no -fi - -if [ "${hb_sysdir}" = "yes" ]; then - export HB_BIN_INSTALL="$HB_INSTALL_PREFIX/bin" - export HB_INC_INSTALL="$HB_INSTALL_PREFIX/include/${name}" - export HB_LIB_INSTALL="$HB_INSTALL_PREFIX/$HB_LIBDIRNAME/${name}" -else - export HB_BIN_INSTALL="$HB_INSTALL_PREFIX/bin" - export HB_INC_INSTALL="$HB_INSTALL_PREFIX/include" - export HB_LIB_INSTALL="$HB_INSTALL_PREFIX/$HB_LIBDIRNAME" -fi - # build umask 022 $MAKE clean $MAKE -for l in ${hb_contrib} -do - (cd "contrib/$l" - $MAKE clean - $MAKE ) -done - # install rm -fR "${HB_INST_PREF}" - -export _DEFAULT_BIN_DIR=$HB_BIN_INSTALL -export _DEFAULT_INC_DIR=$HB_INC_INSTALL -export _DEFAULT_LIB_DIR=$HB_LIB_INSTALL -export HB_BIN_INSTALL="$HB_INST_PREF$HB_BIN_INSTALL" -export HB_INC_INSTALL="$HB_INST_PREF$HB_INC_INSTALL" -export HB_LIB_INSTALL="$HB_INST_PREF$HB_LIB_INSTALL" - -mkdir -p $HB_BIN_INSTALL -mkdir -p $HB_INC_INSTALL -mkdir -p $HB_LIB_INSTALL $MAKE -i install -for l in ${hb_contrib} -do - (cd "contrib/$l" - $MAKE -i install) -done - -# Keep the size of the binaries to a minimim. -if [ -f $HB_BIN_INSTALL/harbour${hb_exesuf} ]; then - ${HB_CCPREFIX}strip $HB_BIN_INSTALL/harbour${hb_exesuf} -fi -if [ "$HB_PLATFORM" != "hpux" ]; then - # Keep the size of the libraries to a minimim, but don't try to strip symlinks. - ${HB_CCPREFIX}strip -S `find $HB_LIB_INSTALL -type f` -fi if [ "${hb_sysdir}" = "yes" ]; then -mkdir -p $HB_INST_PREF$ETC/harbour -cp -f source/rtl/gtcrs/hb-charmap.def $HB_INST_PREF$ETC/harbour/hb-charmap.def -chmod 644 $HB_INST_PREF$ETC/harbour/hb-charmap.def + mkdir -p $HB_INST_PREF$ETC/harbour + cp -f source/rtl/gtcrs/hb-charmap.def $HB_INST_PREF$ETC/harbour/hb-charmap.def + chmod 644 $HB_INST_PREF$ETC/harbour/hb-charmap.def -cat > $HB_INST_PREF$ETC/harbour.cfg < $HB_INST_PREF$ETC/harbour.cfg <