From ec1e80e14054ca7cba9d330e73a5d287c11a3498 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sun, 20 Sep 2009 16:12:43 +0000 Subject: [PATCH] 2009-09-20 18:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/harbour-win-spec * harbour/harbour-wce-spec * harbour/bin/hb-func.sh * harbour/config/global.mk * updated to work with modified base make internals and envvars * do not overload defined by user HB_TOOLS_PREF ! fixed c&p typo in DJGPP cross build HB_TOOLS_PREF Warning: it still needs export HB_BUILD_SHARED=no before creating RPMs but it should be fixed in base make together with native builds. TODO: we should agree some conditions for alternative system wide cross build installation, like .cfg file name and localization. --- harbour/ChangeLog | 13 +++++++++++++ harbour/bin/hb-func.sh | 8 ++------ harbour/config/global.mk | 12 +++++++++--- harbour/harbour-wce-spec | 37 ++++++++----------------------------- harbour/harbour-win-spec | 35 +++++++---------------------------- 5 files changed, 39 insertions(+), 66 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9ae6cd3e82..35b6d8988a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,19 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-20 18:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/harbour-win-spec + * harbour/harbour-wce-spec + * harbour/bin/hb-func.sh + * harbour/config/global.mk + * updated to work with modified base make internals and envvars + * do not overload defined by user HB_TOOLS_PREF + ! fixed c&p typo in DJGPP cross build HB_TOOLS_PREF + Warning: it still needs export HB_BUILD_SHARED=no before creating + RPMs but it should be fixed in base make together with native builds. + TODO: we should agree some conditions for alternative system wide + cross build installation, like .cfg file name and localization. + 2009-09-20 17:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ; Fixes based on Przemek's extensive tests/suggestions on different *nix systems. diff --git a/harbour/bin/hb-func.sh b/harbour/bin/hb-func.sh index 6ca389fc20..86d74cb193 100755 --- a/harbour/bin/hb-func.sh +++ b/harbour/bin/hb-func.sh @@ -257,7 +257,7 @@ mk_hbtools() CC_HB_USER_CFLAGS="${CC_HB_USER_CFLAGS} -fpic" fi - hb_hbmkcfg="$1/hbmk.cfg" + hb_hbmkcfg="$1/${hb_pref}mk.cfg" hb_mkdef="{${HB_PLATFORM}&${HB_COMPILER}}" echo "Making ${hb_hbmkcfg}... " echo "# hbmk2 configuration"> ${hb_hbmkcfg} @@ -892,11 +892,7 @@ mk_hblibso() fi full_lib_name="${lib_pref}${name}${lib_suff}" full_lib_name_mt="${lib_pref}${name}mt${lib_suff}" - if [ -n "${HB_TOOLS_PREF}" ]; then - hb_mkdyn="${HB_BIN_INSTALL}/${HB_TOOLS_PREF}-mkdyn" - else - hb_mkdyn="${HB_BIN_INSTALL}/hb-mkdyn" - fi + hb_mkdyn="${HB_BIN_INSTALL}/${HB_TOOLS_PREF-hb}-mkdyn" # echo "Making ${full_lib_name}..." # ${hb_mkdyn} ${full_lib_name} ${LIBS} ${linker_options} # if [ "${LIBS}" != "${LIBSMT}" ]; then diff --git a/harbour/config/global.mk b/harbour/config/global.mk index fde4565374..eee6d0a3db 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -554,7 +554,9 @@ ifeq ($(HB_COMPILER),) HB_COMP_PATH := $(dir $(HB_CCPATH)) HB_COMPILER := mingw HB_PLATFORM := win - export HB_TOOLS_PREF := hbw + ifeq ($(HB_TOOLS_PREF),) + export HB_TOOLS_PREF := hbw + endif export HB_BUILD_EXTDEF := no ifneq ($(HB_BUILD_PART),all) HB_BUILD_PART := lib @@ -616,7 +618,9 @@ ifeq ($(HB_COMPILER),) ifneq ($(HB_CCPATH)$(HB_CCPREFIX),) HB_COMP_PATH := $(dir $(HB_CCPATH)) HB_PLATFORM := wce - export HB_TOOLS_PREF := hbce + ifeq ($(HB_TOOLS_PREF),) + export HB_TOOLS_PREF := hbce + endif export HB_BUILD_EXTDEF := no ifneq ($(HB_BUILD_PART),all) HB_BUILD_PART := lib @@ -654,7 +658,9 @@ ifeq ($(HB_COMPILER),) ifneq ($(HB_CCPATH)$(HB_CCPREFIX),) HB_COMP_PATH := $(dir $(HB_CCPATH)) HB_PLATFORM := dos - export HB_TOOLS_PREF := hbce + ifeq ($(HB_TOOLS_PREF),) + export HB_TOOLS_PREF := hbdos + endif export HB_BUILD_EXTDEF := no ifneq ($(HB_BUILD_PART),all) HB_BUILD_PART := lib diff --git a/harbour/harbour-wce-spec b/harbour/harbour-wce-spec index 638535357f..04d92f5fdd 100644 --- a/harbour/harbour-wce-spec +++ b/harbour/harbour-wce-spec @@ -27,7 +27,7 @@ %define name harbour-wce %define version 2.0.0 %define releasen beta3 -%define hb_pref hbwce +%define hb_pref hbce %define hb_ccpath /opt/mingw32ce/bin %define hb_ccpref arm-wince-mingw32ce- %define hb_host www.harbour-project.org @@ -89,28 +89,15 @@ rm -fR $RPM_BUILD_ROOT export HB_BUILD_PART=compiler export HB_PLATFORM=linux export HB_COMPILER=gcc -export HB_USER_CFLAGS= make %{?_smp_mflags} +unset HB_COMPILER export HB_BUILD_PART=lib export HB_PLATFORM=wce -export HB_COMPILER=mingwarm export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" - export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINCE -D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" -export HB_CCPATH="%{hb_ccpath}/" -export HB_CCPREFIX="%{hb_ccpref}" -export PATH="%{hb_ccpath}:$PATH" - -export HB_BUILD_EXTDEF=no -export HB_BIN_INSTALL=%{_bindir} -export HB_INC_INSTALL=%{_includedir}/%{name} -export HB_LIB_INSTALL=%{_libdir}/%{name} -export HB_CONTRIBLIBS="gtwvg hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmzip hbnetio hbtip hbvpdf hbwin hbziparc rddado xhb %{!?_without_nf:hbnf} %{?_with_odbc:hbodbc} %{?_with_curl:hbcurl} %{?_with_ads:rddads} %{?_with_gd:hbgd} %{?_with_pgsql:hbpgsql} %{?_with_mysql:hbmysql} %{?_with_allegro:gtalleg}" -export HB_EXTERNALLIBS=no - make %{?_smp_mflags} ###################################################################### @@ -123,22 +110,16 @@ make %{?_smp_mflags} export HB_BUILD_PART=lib export HB_PLATFORM=wce -export HB_COMPILER=mingwarm +unset HB_COMPILER export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINCE -D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" -export HB_CCPATH="%{hb_ccpath}/" -export HB_CCPREFIX="%{hb_ccpref}" -export PATH="%{hb_ccpath}:$PATH" - -export HB_BUILD_EXTDEF=no export HB_BIN_INSTALL=%{_bindir} export HB_INC_INSTALL=%{_includedir}/%{name} export HB_LIB_INSTALL=%{_libdir}/%{name} -export HB_CONTRIBLIBS="gtwvg hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmzip hbnetio hbtip hbvpdf hbwin hbziparc rddado xhb %{!?_without_nf:hbnf} %{?_with_odbc:hbodbc} %{?_with_curl:hbcurl} %{?_with_ads:rddads} %{?_with_gd:hbgd} %{?_with_pgsql:hbpgsql} %{?_with_mysql:hbmysql} %{?_with_allegro:gtalleg}" -export HB_EXTERNALLIBS=no +export HB_DYN_INSTALL=${HB_LIB_INSTALL} export _DEFAULT_BIN_DIR=$HB_BIN_INSTALL export _DEFAULT_INC_DIR=$HB_INC_INSTALL @@ -146,13 +127,11 @@ export _DEFAULT_LIB_DIR=$HB_LIB_INSTALL export HB_BIN_INSTALL=$RPM_BUILD_ROOT/$HB_BIN_INSTALL export HB_INC_INSTALL=$RPM_BUILD_ROOT/$HB_INC_INSTALL export HB_LIB_INSTALL=$RPM_BUILD_ROOT/$HB_LIB_INSTALL -export HB_TOOLS_PREF=%{hb_pref} +export HB_DYN_INSTALL=${HB_LIB_INSTALL} mkdir -p $HB_BIN_INSTALL -mkdir -p $HB_INC_INSTALL -mkdir -p $HB_LIB_INSTALL -make -i install %{?_smp_mflags} +make install %{?_smp_mflags} [ "%{?_with_odbc:1}" ] || rm -f $HB_LIB_INSTALL/libhbodbc.a [ "%{?_with_allegro:1}" ] || rm -f $HB_LIB_INSTALL/libgtalleg.a @@ -160,7 +139,7 @@ make -i install %{?_smp_mflags} [ "%{?_without_nf:1}" ] && rm -f $HB_LIB_INSTALL/libhbnf.a # Keep the size of the libraries to a minimim. -${HB_CCPREFIX}strip --strip-debug $HB_LIB_INSTALL/* +%{__strip} --strip-debug $HB_LIB_INSTALL/* # remove unused files rm -fR ${HB_BIN_INSTALL}/{harbour,hbpp,hbmk2,hbrun,hbi18n,hbtest}.exe @@ -290,7 +269,7 @@ rm -fR $RPM_BUILD_ROOT %{_bindir}/%{hb_pref}cmp %{_bindir}/%{hb_pref}lnk %{_bindir}/%{hb_pref}mk -%{_bindir}/hbmk.cfg +%{_bindir}/%{hb_pref}mk.cfg %defattr(644,root,root,755) %dir %{_includedir}/%{name} diff --git a/harbour/harbour-win-spec b/harbour/harbour-win-spec index 3e335bcfad..e2bbe8e266 100644 --- a/harbour/harbour-win-spec +++ b/harbour/harbour-win-spec @@ -89,28 +89,15 @@ rm -fR $RPM_BUILD_ROOT export HB_BUILD_PART=compiler export HB_PLATFORM=linux export HB_COMPILER=gcc -export HB_USER_CFLAGS= make %{?_smp_mflags} +unset HB_COMPILER export HB_BUILD_PART=lib export HB_PLATFORM=win -export HB_COMPILER=mingw export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" - export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" -export HB_CCPATH="%{hb_ccpath}/" -export HB_CCPREFIX="%{hb_ccpref}" -export PATH="%{hb_ccpath}:$PATH" - -export HB_BUILD_EXTDEF=no -export HB_BIN_INSTALL=%{_bindir} -export HB_INC_INSTALL=%{_includedir}/%{name} -export HB_LIB_INSTALL=%{_libdir}/%{name} -export HB_CONTRIBLIBS="gtwvg hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmzip hbnetio hbtip hbvpdf hbwin hbziparc rddado xhb %{!?_without_nf:hbnf} %{?_with_odbc:hbodbc} %{?_with_curl:hbcurl} %{?_with_ads:rddads} %{?_with_gd:hbgd} %{?_with_pgsql:hbpgsql} %{?_with_mysql:hbmysql} %{?_with_allegro:gtalleg}" -export HB_EXTERNALLIBS=no - make %{?_smp_mflags} ###################################################################### @@ -123,22 +110,16 @@ make %{?_smp_mflags} export HB_BUILD_PART=lib export HB_PLATFORM=win -export HB_COMPILER=mingw +unset HB_COMPILER export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" -export HB_CCPATH="%{hb_ccpath}/" -export HB_CCPREFIX="%{hb_ccpref}" -export PATH="%{hb_ccpath}:$PATH" - -export HB_BUILD_EXTDEF=no export HB_BIN_INSTALL=%{_bindir} export HB_INC_INSTALL=%{_includedir}/%{name} export HB_LIB_INSTALL=%{_libdir}/%{name} -export HB_CONTRIBLIBS="gtwvg hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmzip hbnetio hbtip hbvpdf hbwin hbziparc rddado xhb %{!?_without_nf:hbnf} %{?_with_odbc:hbodbc} %{?_with_curl:hbcurl} %{?_with_ads:rddads} %{?_with_gd:hbgd} %{?_with_pgsql:hbpgsql} %{?_with_mysql:hbmysql} %{?_with_allegro:gtalleg}" -export HB_EXTERNALLIBS=no +export HB_DYN_INSTALL=${HB_LIB_INSTALL} export _DEFAULT_BIN_DIR=$HB_BIN_INSTALL export _DEFAULT_INC_DIR=$HB_INC_INSTALL @@ -146,13 +127,11 @@ export _DEFAULT_LIB_DIR=$HB_LIB_INSTALL export HB_BIN_INSTALL=$RPM_BUILD_ROOT/$HB_BIN_INSTALL export HB_INC_INSTALL=$RPM_BUILD_ROOT/$HB_INC_INSTALL export HB_LIB_INSTALL=$RPM_BUILD_ROOT/$HB_LIB_INSTALL -export HB_TOOLS_PREF=%{hb_pref} +export HB_DYN_INSTALL=${HB_LIB_INSTALL} mkdir -p $HB_BIN_INSTALL -mkdir -p $HB_INC_INSTALL -mkdir -p $HB_LIB_INSTALL -make -i install %{?_smp_mflags} +make install %{?_smp_mflags} [ "%{?_with_odbc:1}" ] || rm -f $HB_LIB_INSTALL/libhbodbc.a [ "%{?_with_allegro:1}" ] || rm -f $HB_LIB_INSTALL/libgtalleg.a @@ -160,7 +139,7 @@ make -i install %{?_smp_mflags} [ "%{?_without_nf:1}" ] && rm -f $HB_LIB_INSTALL/libhbnf.a # Keep the size of the libraries to a minimim. -${HB_CCPREFIX}strip --strip-debug $HB_LIB_INSTALL/* +%{__strip} --strip-debug $HB_LIB_INSTALL/* # remove unused files rm -fR ${HB_BIN_INSTALL}/{harbour,hbpp,hbmk2,hbrun,hbi18n,hbtest}.exe @@ -290,7 +269,7 @@ rm -fR $RPM_BUILD_ROOT %{_bindir}/%{hb_pref}cmp %{_bindir}/%{hb_pref}lnk %{_bindir}/%{hb_pref}mk -%{_bindir}/hbmk.cfg +%{_bindir}/%{hb_pref}mk.cfg %defattr(644,root,root,755) %dir %{_includedir}/%{name}