ARG_GSMAKE="$GNUSTEP_MAKEFILES"
ARG_CFGMAKE="$PWD/config.make"
ARG_WITH_GNUSTEP=0
-ARG_WITH_DEBUG=0
+ARG_WITH_DEBUG=1
+ARG_WITH_STRIP=1
DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
DARG_IS_FHS=1
NGSTREAMS_DIR="./sope-core/NGStreams"
+LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib"
# ******************** usage ********************
--configmake=PATH path to the config file being created
--with-gnustep install in GNUstep tree
--enable-debug turn on debugging and compile time warnings
+ --enable-strip turn on stripping of debug symbols
_ACEOF
else
echo " debug: no";
fi
+ if test $ARG_WITH_STRIP = 1; then
+ echo " strip: yes";
+ else
+ echo " strip: no";
+ fi
echo " prefix: $ARG_PREFIX"
echo " gstep: $ARG_GSMAKE"
fi
}
+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"
+ echo ""
+ fi
+ fi
+}
+
function validateArgs() {
# validate prefix (could be better?)
case "x$ARG_PREFIX" in
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 ""
+ #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?
fi
cfgwrite ""
+ if test $ARG_WITH_STRIP = 1; then
+ cfgwrite "# configured to produce stripped code";
+ cfgwrite "strip:=yes"
+ else
+ cfgwrite "# configured not to strip code";
+ cfgwrite "strip:=no"
+ fi
+ cfgwrite ""
+
cfgwrite "# enforce shared libraries";
cfgwrite "shared:=yes"
cfgwrite ""
cfgwrite "${MAKE_ASSI}";
done
cfgwrite "LIBRARY_COMBO=$LIBRARY_COMBO"
+ cfgwrite ""
+
+ cfgwrite "# avoid a gstep-make warning"
+ cfgwrite "PATH:=\$(GNUSTEP_SYSTEM_ROOT)/Tools:\$(PATH)"
+}
+
+function checkLinking() {
+ local oldpwd=$PWD
+ local tmpdir=".configure-test-$$"
+
+ mkdir $tmpdir
+ cd $tmpdir
+ cp ../maintenance/dummytool.m .
+
+ tmpmake="GNUmakefile"
+ echo >$tmpmake "include ../config.make"
+ echo >>$tmpmake "include \$(GNUSTEP_MAKEFILES)/common.make"
+ echo >>$tmpmake "TOOL_NAME := linktest"
+ echo >>$tmpmake "linktest_OBJC_FILES := dummytool.m"
+ echo >>$tmpmake "linktest_TOOL_LIBS += -l$1"
+ 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
+ LINK_RESULT=$?
+
+ if test $LINK_RESULT = 0; then
+ echo "$2 library found: $1"
+ else
+ if test "x$2" = "xrequired"; then
+ echo "failed to link $2 library: $1"
+ rm ../config.make
+ exit 1
+ else
+ echo "failed to link $2 library: $1"
+ fi
+ fi
+
+ cd $oldpwd
+ rm -rf $tmpdir
+}
+
+function checkDependencies() {
+ checkLinking "xml2" required;
+ checkLinking "ldap" required;
+ checkLinking "ssl" required; # TODO: make optional
+ checkLinking "pq" required; # TODO: make optional
}
function runIt() {
fi
else
genConfigMake;
+ checkDependencies;
if test -x $NGSTREAMS_DIR/configure; then
if test $ARG_BEQUIET != 1; then
"x--enable-debug")
ARG_WITH_DEBUG=1
;;
+ "x--disable-debug")
+ ARG_WITH_DEBUG=0
+ ;;
+ "x--enable-strip")
+ ARG_WITH_STRIP=1
+ ;;
+ "x--disable-strip")
+ ARG_WITH_STRIP=0
+ ;;
*) echo "error: cannot process argument: $1"; exit 1; ;;
esac
printGNUstepSetup;
fi
+# setup some GNUstep dependend defaults
+if test "x$GNUSTEP_HOST_VENDOR" = "xapple"; then
+ setupAppleArgs;
+fi
+
# ensure the parameters make sense
validateArgs