From: sreitenbach Date: Sun, 3 Feb 2008 13:48:13 +0000 (+0000) Subject: * exchange bash with sh in configure X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fcd80a08ea8e1f2daa158d6d182f998648ac8a8;p=scalable-opengroupware.org * exchange bash with sh in configure * autodetect the correct gmake in configure * 64Bit CGS_LIBDIR_NAME changes in configure * OpenBSD compatibility in configure * gnustep-make 2 compatibility for all git-svn-id: http://svn.opengroupware.org/SOGo/inverse/branches/1.0-gsmake2@1349 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOPE/GDLContentStore/GNUmakefile b/SOPE/GDLContentStore/GNUmakefile index 5de46243..eca654b2 100644 --- a/SOPE/GDLContentStore/GNUmakefile +++ b/SOPE/GDLContentStore/GNUmakefile @@ -13,7 +13,8 @@ FRAMEWORK_NAME = GDLContentStore endif libGDLContentStore_PCH_FILE = common.h -libGDLContentStore_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION) +libGDLContentStore_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) +libGDLContentStore_INSTALL_DIR=$(SOGO_SYSLIBDIR) libGDLContentStore_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) TOOL_NAME = gcs_ls gcs_mkdir gcs_cat gcs_recreatequick gcs_gensql @@ -68,10 +69,12 @@ GDLContentStore_SUBPROJECTS = $(libGDLContentStore_SUBPROJECTS) -include GNUmakefile.preamble ifneq ($(frameworks),yes) +ifneq ($(FHS_INSTALL_ROOT),) +GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include +endif include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble -include fhs.make diff --git a/SOPE/GDLContentStore/GNUmakefile.preamble b/SOPE/GDLContentStore/GNUmakefile.preamble index ada5aa19..4ef86a82 100644 --- a/SOPE/GDLContentStore/GNUmakefile.preamble +++ b/SOPE/GDLContentStore/GNUmakefile.preamble @@ -73,6 +73,6 @@ libGDLContentStore_PREBIND_ADDR="0xC7700000" libGDLContentStore_LDFLAGS += -seg1addr $(libGDLContentStore_PREBIND_ADDR) endif -ifeq ($(findstring openbsd3, $(GNUSTEP_HOST_OS)), openbsd3) +ifeq ($(findstring openbsd, $(GNUSTEP_HOST_OS)), openbsd) GCS_TOOL_LIBS += -liconv endif diff --git a/SOPE/NGCards/GNUmakefile b/SOPE/NGCards/GNUmakefile index 65d370bb..7c324434 100644 --- a/SOPE/NGCards/GNUmakefile +++ b/SOPE/NGCards/GNUmakefile @@ -1,6 +1,6 @@ # GNUstep makefile --include ../../config.make +include ../../config.make include $(GNUSTEP_MAKEFILES)/common.make include ./Version @@ -12,11 +12,10 @@ else FRAMEWORK_NAME = NGCards endif -FHS_HEADER_DIRS = NGCards - libNGCards_HEADER_FILES_DIR = . libNGCards_HEADER_FILES_INSTALL_DIR = /NGCards -libNGCards_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION) +libNGCards_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) +libNGCards_INSTALL_DIR=$(SOGO_SYSLIBDIR) libNGCards_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) libNGCards_HEADER_FILES = \ @@ -118,10 +117,12 @@ NGCards_SUBPROJECTS = $(libNGCards_SUBPROJECTS) -include GNUmakefile.preamble ifneq ($(frameworks),yes) +ifneq ($(FHS_INSTALL_ROOT),) +GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include +endif include $(GNUSTEP_MAKEFILES)/library.make else include $(GNUSTEP_MAKEFILES)/framework.make endif include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble --include ../../fhslib.make diff --git a/SOPE/NGCards/GNUmakefile.postamble b/SOPE/NGCards/GNUmakefile.postamble index 8074f126..b45713ad 100644 --- a/SOPE/NGCards/GNUmakefile.postamble +++ b/SOPE/NGCards/GNUmakefile.postamble @@ -1,10 +1,6 @@ # compilation settings -ifeq ($(FHS_INSTALL_ROOT),) -MAPDIR="$(GNUSTEP_INSTALLATION_DIR)/Library/SaxMappings/" -else -MAPDIR="$(FHS_INSTALL_ROOT)/share/sope-$(MAJOR_VERSION).$(MINOR_VERSION)/saxmappings/" -endif +MAPDIR="$(SOPE_SAXMAPPINGS)" mappings-dir :: $(MKDIRS) $(MAPDIR) diff --git a/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile b/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile index 0782266b..b28f46d9 100644 --- a/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile +++ b/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile @@ -1,12 +1,12 @@ # GNUstep makefile --include ../../../config.make +include ../../../config.make include $(GNUSTEP_MAKEFILES)/common.make -include ./Version BUNDLE_NAME = versitCardsSaxDriver BUNDLE_EXTENSION = .sax -BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/SaxDrivers-$(MAJOR_VERSION).$(MINOR_VERSION)/ +BUNDLE_INSTALL_DIR = ${SOPE_SAXDRIVERS}/ versitCardsSaxDriver_PRINCIPAL_CLASS = VSCardSaxDriver @@ -22,4 +22,3 @@ versitCardsSaxDriver_RESOURCE_FILES = bundle-info.plist -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble -include fhs.make diff --git a/configure b/configure index 01ffca01..61f31bfd 100755 --- a/configure +++ b/configure @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Note: When adding make options to this script, ensure that the source still @@ -14,7 +14,7 @@ CFG_ARGS="$0 $1 $2 $3 $4 $5 $6 $7 $8 $9" ARG_BEQUIET=0 ARG_NOCREATE=0 ARG_PREFIX="" -ARG_GSMAKE="$GNUSTEP_MAKEFILES" +ARG_GSMAKE=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null` ARG_CFGMAKE="$PWD/config.make" ARG_WITH_GNUSTEP=1 ARG_WITH_DEBUG=1 @@ -23,12 +23,20 @@ ARG_WITH_STRIP=1 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh" DARG_IS_FHS=1 +# detect GNU make, needed at least on *BSD +make -v 2>/dev/null | grep GNU >/dev/null 2>/dev/null +if [ $? -eq 0 ];then + MAKE=make +else + MAKE=gmake +fi + NGSTREAMS_DIR="./sope-core/NGStreams" LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib" # ******************** usage ******************** -function usage() { +usage() { cat <<_ACEOF \`configure' configures a GNUstep-make based sourcetree for installation. @@ -58,7 +66,7 @@ _ACEOF # ******************** running ******************** -function printParas() { +printParas() { echo "Configuration:" if test $ARG_BEQUIET = 1; then echo " will be quite."; fi if test $ARG_NOCREATE = 1; then echo " won't create files"; fi @@ -86,7 +94,7 @@ function printParas() { echo "" } -function warnOnFHSPrefix() { +warnOnFHSPrefix() { cat <<_ACEOFWARN Warning: you are configuring for a non standard FHS style prefix. prefix: $ARG_PREFIX @@ -103,7 +111,7 @@ environment. _ACEOFWARN } -function validateGNUstepArgs() { +validateGNUstepArgs() { # GNUstep make if test "x$ARG_GSMAKE" = "x"; then if test -f $HOME/OGoRoot/Library/Makefiles/GNUstep.sh; then @@ -133,7 +141,7 @@ function validateGNUstepArgs() { fi } -function setupAppleArgs() { +setupAppleArgs() { ARG_WITH_STRIP=0 ARG_WITH_GNUSTEP=1 @@ -145,7 +153,7 @@ function setupAppleArgs() { fi } -function validateArgs() { +validateArgs() { # validate prefix (could be better?) case "x$ARG_PREFIX" in "x/usr/local"|"x/usr/local/") @@ -195,7 +203,7 @@ function validateArgs() { fi } -function printGNUstepSetup() { +printGNUstepSetup() { echo "GNUstep environment:" echo " system: ${GNUSTEP_SYSTEM_ROOT}" echo " local: ${GNUSTEP_LOCAL_ROOT}" @@ -207,11 +215,11 @@ function printGNUstepSetup() { echo "" } -function cfgwrite() { +cfgwrite() { echo "$1" >> $ARG_CFGMAKE } -function genConfigMake() { +genConfigMake() { # we ignore the following vars also patches by gstep-make: # PATH # DYLD_LIBRARY_PATH @@ -227,15 +235,18 @@ function genConfigMake() { cfgwrite "" cfgwrite "# Note: you can override any option as a 'make' parameter, eg:" - cfgwrite "# make debug=yes" + cfgwrite "# $MAKE debug=yes" cfgwrite "" #cfgwrite "# print on the cmdline that this file is being used" #cfgwrite "all :: " #cfgwrite " @echo Local GNUstep config.make is active" #cfgwrite "" - - # TODO: should be also write a GNUSTEP_INSTALLATION_DIR / BUNDLE_INSTALL_DIR? + + cfgwrite "SOGO_MAJOR_VERSION=0" + cfgwrite "SOGO_MINOR_VERSION=9" + cfgwrite "SOPE_MAJOR_VERSION=4" + cfgwrite "SOPE_MINOR_VERSION=7" if test $DARG_IS_FHS = 1; then cfgwrite "# configured for FHS install" @@ -251,7 +262,59 @@ function genConfigMake() { cfgwrite "debug:=no" fi cfgwrite "" - + UNAME=`uname` + if [ "X${UNAME}" = "XLinux" ];then + UNAME=`uname -p` + if [ ${UNAME} = x86_64 -o ${UNAME} = sparc64 -o ${UNAME} = ppc64 ];then + cfgwrite "CGS_LIBDIR_NAME:=lib64" + else + cfgwrite "CGS_LIBDIR_NAME:=lib" + fi + else + cfgwrite "CGS_LIBDIR_NAME:=lib" + fi + + cfgwrite "ifneq (\$(FHS_INSTALL_ROOT),)" + cfgwrite "CONFIGURE_FHS_INSTALL_LIBDIR:=\$(FHS_INSTALL_ROOT)/\$(CGS_LIBDIR_NAME)/" +# cfgwrite "CONFIGURE_SYSTEM_LIB_DIR += -L\$(CONFIGURE_FHS_INSTALL_LIBDIR)" + cfgwrite "endif" +# cfgwrite "CONFIGURE_SYSTEM_LIB_DIR += -L/usr/\$(CGS_LIBDIR_NAME)/" + + if test $DARG_IS_FHS = 1; then + cfgwrite "# configured for FHS install" + cfgwrite "FHS_INSTALL_ROOT:=$ARG_PREFIX" + cfgwrite "" + cfgwrite "SOGO_SYSLIBDIR=\${DESTDIR}\${FHS_INSTALL_ROOT}/\${CGS_LIBDIR_NAME}" + cfgwrite "SOGO_LIBDIR=\${SOGO_SYSLIBDIR}/sogod-\${SOGO_MAJOR_VERSION}.\${SOGO_MINOR_VERSION}" + cfgwrite "SOPE_LIBDIR=\$(SOGO_SYSLIBDIR)/sope-\${SOPE_MAJOR_VERSION}.\${SOPE_MINOR_VERSION}" + cfgwrite "SOGO_SYSSHAREDIR=\${DESTDIR}\${FHS_INSTALL_ROOT}/share" + cfgwrite "SOGO_SHARED=\${SOGO_SYSSHAREDIR}/sogo-\${SOGO_MAJOR_VERSION}.\${SOGO_MINOR_VERSION}" + cfgwrite "SOPE_SHARED=\${SOGO_SYSSHAREDIR}/sope-\${SOPE_MAJOR_VERSION}.\${SOPE_MINOR_VERSION}" + cfgwrite "SOGO_TEMPLATESDIR=\${SOGO_SHARED}/templates" + cfgwrite "SOGO_WEBSERVERRESOURCESDIR=\${SOGO_SHARED}/www" + cfgwrite "SOGO_TOOLS=\${DESTDIR}\${FHS_INSTALL_ROOT}/bin" + cfgwrite "SOGO_ADMIN_TOOLS=\${DESTDIR}\${FHS_INSTALL_ROOT}/sbin" + cfgwrite "SOPE_SAXMAPPINGS=\${SOPE_SHARED}/saxmappings" + cfgwrite "SOPE_SAXDRIVERS=\${SOPE_LIBDIR}/saxdrivers" + cfgwrite "SOPE_WOXBUILDERS=\${SOPE_LIBDIR}/wox-builders" + cfgwrite "SOGO_TYPEMODELS=\${SOGO_SYSSHAREDIR}/ocs" + + cfgwrite "" + else + cfgwrite "# configured for GNUstep install" + cfgwrite "" + cfgwrite "SOGO_SYSLIBDIR=\${DESTDIR}/\${GNUSTEP_LIBRARY}/Libraries" + cfgwrite "SOGO_LIBDIR=\${DESTDIR}/\${GNUSTEP_LIBRARY}/SOGo-\${SOGO_MAJOR_VERSION}.\${SOGO_MINOR_VERSION}" + cfgwrite "SOGO_TEMPLATESDIR=\${SOGO_LIBDIR}/Templates" + cfgwrite "SOGO_WEBSERVERRESOURCESDIR=\${SOGO_LIBDIR}/WebServerResources" + cfgwrite "SOGO_TOOLS=\${DESTDIR}/\${GNUSTEP_TOOLS}" + cfgwrite "SOGO_ADMIN_TOOLS=\${DESTDIR}/\${GNUSTEP_ADMIN_TOOLS}" + cfgwrite "SOPE_SAXMAPPINGS=\${DESTDIR}/\${GNUSTEP_LIBRARY}/SaxMappings" + cfgwrite "SOPE_SAXDRIVERS=\${DESTDIR}/\${GNUSTEP_LIBRARY}/SaxDrivers-\${SOPE_MAJOR_VERSION}.\${SOPE_MINOR_VERSION}" + cfgwrite "SOPE_WOXBUILDERS=\${DESTDIR}/\${GNUSTEP_LIBRARY}/WOxElemBuilders-\${SOPE_MAJOR_VERSION}.\${SOPE_MINOR_VERSION}" + cfgwrite "SOGO_TYPEMODELS=\${DESTDIR}/\${GNUSTEP_LIBRARY}/OCSTypeModels" + fi + if test $ARG_WITH_STRIP = 1; then cfgwrite "# configured to produce stripped code"; cfgwrite "strip:=yes" @@ -273,11 +336,9 @@ function genConfigMake() { cfgwrite "LIBRARY_COMBO=$LIBRARY_COMBO" cfgwrite "" - cfgwrite "# avoid a gstep-make warning" - cfgwrite "PATH:=\$(GNUSTEP_SYSTEM_ROOT)/Tools:\$(PATH)" } -function checkLinking() { +checkLinking() { local oldpwd=$PWD local tmpdir=".configure-test-$$" @@ -294,7 +355,7 @@ function checkLinking() { echo >>$tmpmake "SYSTEM_LIB_DIR += ${LINK_SYSLIBDIRS}" echo >>$tmpmake "include \$(GNUSTEP_MAKEFILES)/tool.make" - make -s messages=yes -f $tmpmake linktest >out.log 2>err.log + $MAKE -s messages=yes -f $tmpmake linktest >out.log 2>err.log LINK_RESULT=$? if test $LINK_RESULT = 0; then @@ -313,12 +374,12 @@ function checkLinking() { rm -rf $tmpdir } -function checkDependencies() { +checkDependencies() { checkLinking "SaxObjC" required; checkLinking "NGLdap" required; } -function runIt() { +runIt() { if test $ARG_BEQUIET != 1; then printParas; fi @@ -346,11 +407,11 @@ function runIt() { # ******************** options ******************** -function extractFuncValue() { +extractFuncValue() { VALUE="`echo "$1" | sed "s/[^=]*=//g"`" } -function processOption() { +processOption() { case "x$1" in "x--help"|"x-h") usage; @@ -401,7 +462,7 @@ done # load GNUstep environment validateGNUstepArgs # first we load the GNUstep.sh environment -source $DARG_GNUSTEP_SH +. $DARG_GNUSTEP_SH if test $ARG_BEQUIET != 1; then printGNUstepSetup; fi