From: helge Date: Sat, 6 Aug 2005 18:04:59 +0000 (+0000) Subject: improved configure system, more libraries are optional now X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13618cf63da975e2c99672ab5a4e9eeec0292ddc;p=sope improved configure system, more libraries are optional now git-svn-id: http://svn.opengroupware.org/SOPE/trunk@984 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/GNUmakefile b/GNUmakefile index 60b164aa..c5f4f7ed 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,14 @@ # GNUstep makefile -include ./config.make + +ifeq ($(GNUSTEP_MAKEFILES),) + +$(warning Note: Your $(GNUSTEP_MAKEFILES) environment variable is empty!) +$(warning Either use ./configure or source GNUstep.sh.) + +else + include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS += \ @@ -8,14 +16,20 @@ SUBPROJECTS += \ sope-core \ sope-mime \ sope-appserver \ - sope-ldap \ sope-ical \ sope-gdl1 \ - xmlrpc_call \ + xmlrpc_call + +ifeq ($(HAS_LIBRARY_ldap),yes) +SUBPROJECTS += sope-ldap +endif + -include $(GNUSTEP_MAKEFILES)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include $(GNUSTEP_MAKEFILES)/GNUmakefile.postamble +endif + distclean :: if test -f config.make; then rm config.make; fi diff --git a/configure b/configure index 985b89b2..07ccb863 100755 --- a/configure +++ b/configure @@ -137,9 +137,9 @@ function setupAppleArgs() { ARG_WITH_STRIP=0 ARG_WITH_GNUSTEP=1 - if test "xLIBRARY_COMBO" != "apple-apple-nil"; then - if test "xLIBRARY_COMBO" != "apple-apple-apple"; then - echo "WARNING: detected unusual GNUstep setup: $LIBRARY_COMBO" + if test "x${xLIBRARY_COMBO}" != "xapple-apple-nil"; then + if test "x${LIBRARY_COMBO}" != "xapple-apple-apple"; then + echo "WARNING: detected unusual GNUstep setup: ${LIBRARY_COMBO}" echo "" fi fi @@ -278,6 +278,7 @@ function genConfigMake() { } function checkLinking() { + # library-name => $1, type => $2 local oldpwd=$PWD local tmpdir=".configure-test-$$" @@ -296,9 +297,10 @@ function checkLinking() { make -s messages=yes -f $tmpmake linktest >out.log 2>err.log LINK_RESULT=$? - + if test $LINK_RESULT = 0; then echo "$2 library found: $1" + cfgwrite "HAS_LIBRARY_$1=yes" else if test "x$2" = "xrequired"; then echo "failed to link $2 library: $1" @@ -306,6 +308,7 @@ function checkLinking() { exit 1 else echo "failed to link $2 library: $1" + cfgwrite "HAS_LIBRARY_$1=no" fi fi @@ -314,10 +317,14 @@ function checkLinking() { } function checkDependencies() { - checkLinking "xml2" required; - checkLinking "ldap" required; - checkLinking "ssl" required; # TODO: make optional - checkLinking "pq" required; # TODO: make optional + cfgwrite "" + cfgwrite "# library dependencies" + checkLinking "xml2" optional; + checkLinking "ldap" optional; + checkLinking "ssl" required; # TODO: make optional + checkLinking "pq" optional; + checkLinking "sqlite3" optional; + checkLinking "mysqlclient" optional; } function runIt() { diff --git a/sope-gdl1/GNUmakefile b/sope-gdl1/GNUmakefile index 7d545061..dee50979 100644 --- a/sope-gdl1/GNUmakefile +++ b/sope-gdl1/GNUmakefile @@ -8,8 +8,19 @@ VERSION=4.5.0 SUBPROJECTS += \ GDLAccess \ - GDLContentStore \ - PostgreSQL + GDLContentStore + +ifeq ($(HAS_LIBRARY_pq),yes) +SUBPROJECTS += PostgreSQL +endif + +ifeq ($(HAS_LIBRARY_sqlite3),yes) +SUBPROJECTS += SQLite3 +endif + +ifeq ($(HAS_LIBRARY_mysqlclient),yes) +SUBPROJECTS += MySQL +endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make diff --git a/sope-xml/GNUmakefile b/sope-xml/GNUmakefile index cf91b49a..7a0a94b2 100644 --- a/sope-xml/GNUmakefile +++ b/sope-xml/GNUmakefile @@ -9,9 +9,12 @@ VERSION=4.5.0 SUBPROJECTS = \ SaxObjC \ DOM \ - libxmlSAXDriver \ STXSaxDriver \ XmlRpc \ - samples \ + samples + +ifeq ($(HAS_LIBRARY_xml2),yes) +SUBPROJECTS += libxmlSAXDriver +endif include $(GNUSTEP_MAKEFILES)/aggregate.make