1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704
|
#!/bin/sh
#
# Note: When adding make options to this script, ensure that the source still
# compiles without those options! (and just with GNUstep.sh being
# sourced)
# We do not want to force people to run configure.
#
# ******************** variables ****************
CFG_ARGS="$0 $1 $2 $3 $4 $5 $6 $7 $8 $9"
ARG_BEQUIET=0
ARG_NOCREATE=0
ARG_PREFIX=""
ARG_FRAMEWORK_DIR=""
ARG_GSMAKE=`gnustep-config --variable=GNUSTEP_MAKEFILES`
ARG_CFGMAKE="$PWD/config.make"
ARG_CFGSSL="auto"
ARG_CABUNDLE="none"
ARG_FHSMAKE="$PWD/fhs-postinstall.make"
ARG_WITH_GNUSTEP=0
ARG_WITH_DEBUG=1
ARG_WITH_STRIP=1
ARG_WITH_MYSQL=auto
ARG_WITH_POSTGRESQL=auto
ARG_WITH_OPENLDAP=auto
ARG_WITH_XML=auto
DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
DARG_IS_FHS=1
SOPE_SRCDIR="$PWD" # TODO: rather use location of configure (using basename)
NGSTREAMS_DIR="${SOPE_SRCDIR}/sope-core/NGStreams"
GSTEPMAKE_SRCDIR="${SOPE_SRCDIR}/gnustep-make"
INTERNAL_MAKEDIR="${SOPE_SRCDIR}/.gsmake"
USES_INTERNAL_MAKE=no
# When we run under make -j (during Debian package build) that option
# is passed to child make invocations using MAKEFLAGS and MFLAGS. We
# unset them so they can't cause problems when running make in
# checkLinking.
unset MAKEFLAGS
unset MFLAGS
# 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
# TODO: add pg_config, mysql_config etc!
LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib"
# ******************** usage ********************
usage() {
cat <<_ACEOF
\`configure' configures a GNUstep-make based sourcetree for installation.
Usage: $0 [OPTION]...
Note: You do not need to configure this source tree, as another option
just ensure that the GNUstep.sh of your GNUstep make installation
is properly sourced prior running make.
Configuration:
-h, --help display this help and exit
-q, --quiet, --silent do not print \`checking...' messages
-n, --no-create do not create output files
Installation directories:
--prefix=PREFIX install files in PREFIX [/usr/local]
--frameworks=DIR build frameworks and install in DIR
--gsmake=PATH path to gnustep-make tree
--configmake=PATH path to the config file being created
Build flags:
--with-gnustep install in GNUstep tree
--enable-debug turn on debugging and compile time warnings
--enable-strip turn on stripping of debug symbols
--with-ssl=SSL specify ssl library (none, ssl, gnutls, auto) [auto]
--ca-bundle=CA_BUNDLE specify path to ca bundle (none, path, auto) [none]
--enable-xml Enable xml support (auto if unspecified)
--enable-mysql Enable mysql support (auto if unspecified)
--enable-postgresql Enable postgresql support (auto if unspecified)
--enable-openldap Enable ldap support (auto if unspecified)
_ACEOF
exit 0;
}
# ******************** running ********************
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
if test "x$ARG_FRAMEWORK_DIR" != "x"; then
echo " FHS: install in frameworks directory";
elif test $DARG_IS_FHS = 1; then
echo " FHS: install in FHS root";
else
echo " FHS: install in GNUstep tree";
fi
if test $ARG_WITH_DEBUG = 1; then
echo " debug: yes";
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 " frameworks: $ARG_FRAMEWORK_DIR"
echo " gstep: $ARG_GSMAKE"
echo " config: $ARG_CFGMAKE"
echo " script: $DARG_GNUSTEP_SH"
echo ""
}
warnOnFHSPrefix() {
cat <<_ACEOFWARN
Warning: you are configuring for a non standard FHS style prefix.
prefix: $ARG_PREFIX
Some code in SOPE only looks in /usr and /usr/local for resources and is
therefore incompatible with arbitary install pathes.
If you want to have the flexibility of installation in arbitary pathes just
configure GNUstep-make and source the GNUstep.sh script prior executing tools
to ensure a proper environment.
All SOPE based code is completely relocatable when being used in a GNUstep
environment.
_ACEOFWARN
}
setupInternalGSMake() {
if test -f "${INTERNAL_MAKEDIR}/Library/Makefiles/GNUstep.sh"; then
ARG_GSMAKE="${INTERNAL_MAKEDIR}/Library/Makefiles/"
ARG_IS_FHS=1
DARG_IS_FHS=1
ARG_WITH_GNUSTEP=0
USES_INTERNAL_MAKE=yes
if test "x$ARG_PREFIX" = "x"; then
ARG_PREFIX="/usr/local/"
fi
elif test -d gnustep-make; then
ENABLE_PCH_OPT=""
SETUP_COMBO="gnu-fd-nil"
SETUP_LOGNAME="config-gstepmake.log"
if test -d /Developer/Applications/Xcode.app; then
# rather weird OSX test, right? ;->
SETUP_COMBO="apple-apple-nil"
ENABLE_PCH_OPT="--enable-pch"
fi
pregsmdir="$PWD"
echo -n "configuring builtin gnustep-make environment (${SETUP_LOGNAME}) .."
cd "$GSTEPMAKE_SRCDIR"
./configure >${pregsmdir}/${SETUP_LOGNAME} \
${ENABLE_PCH_OPT} \
--prefix="${INTERNAL_MAKEDIR}" \
--with-config-file="${INTERNAL_MAKEDIR}/GNUstep.conf" \
--with-system-root="${INTERNAL_MAKEDIR}" \
--with-network-root="${INTERNAL_MAKEDIR}" \
--with-local-root="${INTERNAL_MAKEDIR}" \
--with-user-root="${INTERNAL_MAKEDIR}" \
--with-library-combo="${SETUP_COMBO}"
echo -n ".. install .."
$MAKE install >>${pregsmdir}/${SETUP_LOGNAME}
ARG_GSMAKE="${INTERNAL_MAKEDIR}/Library/Makefiles/"
ARG_IS_FHS=1
DARG_IS_FHS=1
ARG_WITH_GNUSTEP=0
USES_INTERNAL_MAKE=yes
if test "x$ARG_PREFIX" = "x"; then
ARG_PREFIX="/usr/local/"
fi
cd "$pregsmdir"
if test -f $ARG_GSMAKE/GNUstep.sh; then
echo ".. done (log in ${SETUP_LOGNAME})."
else
echo "error: failed to setup embedded gnustep-make sources!"
tail ${pregsmdir}/${SETUP_LOGNAME}
exit 1
fi
else
echo "error: did not find embedded gnustep-make sources!"
exit 1
fi
}
validateGNUstepArgs() {
# GNUstep make
if test "x$ARG_GSMAKE" = "x"; then
if test -f $HOME/OGoRoot/Library/Makefiles/GNUstep.sh; then
ARG_GSMAKE="$HOME/OGoRoot/Library/Makefiles/"
elif test -f $HOME/GNUstep/Library/Makefiles/GNUstep.sh; then
ARG_GSMAKE="$HOME/GNUstep/Library/Makefiles/"
elif test -f /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; then
ARG_GSMAKE="/usr/GNUstep/System/Library/Makefiles/"
else
setupInternalGSMake;
fi
DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
elif test -d $ARG_GSMAKE; then
if test -f $ARG_GSMAKE/GNUstep.sh; then
DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
elif test -f $ARG_GSMAKE/Library/Makefiles/GNUstep.sh; then
ARG_GSMAKE="$ARG_GSMAKE/Library/Makefiles"
DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
else
echo "error: specified directory contains no GNUstep.sh: $ARG_GSMAKE"
exit 1
fi
else
echo "error: specified GNUstep make tree does not exist: $ARG_GSMAKE"
exit 1
fi
}
setupAppleArgs() {
ARG_WITH_STRIP=0
if test "x${USES_INTERNAL_MAKE}" = "no"; then
ARG_WITH_GNUSTEP=1
fi
# no reason to print a warning?
#if test "x${xLIBRARY_COMBO}" != "xapple-apple-nil"; then
# if test "x${LIBRARY_COMBO}" != "xapple-apple-apple"; then
# echo "WARNING: detected MacOSX GNUstep setup: ${LIBRARY_COMBO}"
# echo ""
# fi
#fi
}
validateArgs() {
# validate prefix (could be better?)
case "x$ARG_PREFIX" in
"x/usr/local"|"x/usr/local/")
DARG_IS_FHS=1;
;;
"x/usr"|"x/usr/")
DARG_IS_FHS=1;
;;
"x$GNUSTEP_USER_ROOT"|"x$GNUSTEP_LOCAL_ROOT"|"x$GNUSTEP_SYSTEM_ROOT")
DARG_IS_FHS=0;
ARG_WITH_GNUSTEP=1;
;;
"x")
if test $ARG_WITH_GNUSTEP = 1; then
DARG_IS_FHS=0;
ARG_PREFIX="$GNUSTEP_LOCAL_ROOT"
if test $ARG_BEQUIET != 1; then
echo "Note: will install in GNUSTEP_LOCAL_ROOT: $ARG_PREFIX"
echo ""
fi
elif test "x$ARG_FRAMEWORK_DIR" != "x"; then
DARG_IS_FHS=0;
ARG_PREFIX="$ARG_FRAMEWORK_DIR"
echo "Note: will install in frameworks location: $ARG_PREFIX"
echo ""
else
DARG_IS_FHS=1;
ARG_PREFIX="/usr/local/"
echo "Note: will install in default location: $ARG_PREFIX"
echo ""
fi
;;
*)
if test $ARG_WITH_GNUSTEP = 1; then
echo "error: specified --with-gnustep, but specified prefix is not"
echo " a GNUstep root: '$ARG_PREFIX'"
exit 1
else
if test $ARG_BEQUIET != 1; then
warnOnFHSPrefix;
fi
DARG_IS_FHS=1;
fi
;;
esac
if test $ARG_WITH_GNUSTEP = 1; then
if test $DARG_IS_FHS = 1; then
echo "error: configured for FHS root _and_ GNUstep tree. Choose one!"
exit 1
fi
fi
}
printGNUstepSetup() {
echo "GNUstep environment:"
echo " system: ${GNUSTEP_SYSTEM_ROOT}"
echo " local: ${GNUSTEP_LOCAL_ROOT}"
echo " user: ${GNUSTEP_USER_ROOT}"
echo " path: ${GNUSTEP_PATHLIST}"
echo " flat: ${GNUSTEP_FLATTENED}"
echo " arch: ${GNUSTEP_HOST}"
echo " combo: ${LIBRARY_COMBO}"
echo ""
}
cfgwrite() {
echo "$1" >> "${ARG_CFGMAKE}"
}
genConfigMake() {
# we ignore the following vars also patches by gstep-make:
# PATH
# DYLD_LIBRARY_PATH
# GUILE_LOAD_PATH
# CLASSPATH
if test $ARG_BEQUIET != 1; then
echo "creating: $ARG_CFGMAKE"
fi
echo "# GNUstep environment configuration" > "${ARG_CFGMAKE}"
cfgwrite "# created by: '$CFG_ARGS'"
cfgwrite ""
cfgwrite "SOPE_ROOT=`pwd | sed 's/ /\\\ /g'`"
cfgwrite "include \${SOPE_ROOT}/Version"
cfgwrite "# Note: you can override any option as a 'make' parameter, eg:"
cfgwrite "# make debug=yes"
cfgwrite ""
cfgwrite "NEEDS_GUI=no"
#cfgwrite "# print on the cmdline that this file is being used"
#cfgwrite "all :: "
#cfgwrite " @echo Local GNUstep config.make is active"
#cfgwrite ""
# Note: GNUSTEP_TARGET_CPU is not yet available (set by common.make), so we
# only have environment variables
# Note: we can't set SYSTEM_LIB_DIR in this location, it gets overridden by
# common.make
UNAME=`uname`
if [ "X${UNAME}" = "XLinux" ];then
UNAME=`uname -m`
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 "GNUSTEP_INSTALLATION_DOMAIN:=LOCAL"
cfgwrite "CONFIGURE_SYSTEM_LIB_DIR += -L/usr/\$(CGS_LIBDIR_NAME)/"
if test "x$ARG_FRAMEWORK_DIR" != "x"; then
cfgwrite "# configured to install in Frameworks directory"
cfgwrite "FRAMEWORK_INSTALL_DIR:=${ARG_FRAMEWORK_DIR}"
cfgwrite "frameworks=yes"
cfgwrite ""
elif test $DARG_IS_FHS = 1; then
cfgwrite "# configured for FHS install"
cfgwrite "FHS_INSTALL_ROOT:=$ARG_PREFIX"
cfgwrite ""
cfgwrite "SOPE_SYSLIBDIR=\${DESTDIR}\${FHS_INSTALL_ROOT}/\$(CGS_LIBDIR_NAME)"
cfgwrite "SOPE_LIBDIR=\${SOPE_SYSLIBDIR}/sope-\${MAJOR_VERSION}.\${MINOR_VERSION}"
cfgwrite "SOPE_SYSSHAREDIR=\${DESTDIR}\${FHS_INSTALL_ROOT}/share"
cfgwrite "SOPE_SHAREDIR=\${SOPE_SYSSHAREDIR}/sope-\${MAJOR_VERSION}.\${MINOR_VERSION}"
cfgwrite "SOPE_DBADAPTORS=\${SOPE_LIBDIR}/dbadaptors"
cfgwrite "SOPE_PRODUCTS=\${SOPE_LIBDIR}/products"
cfgwrite "SOPE_SAXDRIVERS=\${SOPE_LIBDIR}/saxdrivers"
cfgwrite "SOPE_WOXBUILDERS=\${SOPE_LIBDIR}/wox-builders"
cfgwrite "SOPE_NGOBJWEB=\${SOPE_SHAREDIR}/ngobjweb"
cfgwrite "SOPE_SAXMAPPINGS=\${SOPE_SHAREDIR}/saxmappings"
cfgwrite "SOPE_TOOLS=\${DESTDIR}\${FHS_INSTALL_ROOT}/bin"
cfgwrite "SOPE_ADMIN_TOOLS=\${DESTDIR}\${FHS_INSTALL_ROOT}/sbin"
cfgwrite ""
else
cfgwrite "# configured for GNUstep install"
cfgwrite ""
cfgwrite "SOPE_SYSLIBDIR=\${GNUSTEP_LIBRARIES}"
cfgwrite "SOPE_LIBDIR=\${GNUSTEP_LIBRARY}"
cfgwrite "SOPE_DBADAPTORS=\${SOPE_LIBDIR}/GDLAdaptors-\${MAJOR_VERSION}.\${MINOR_VERSION}"
cfgwrite "SOPE_PRODUCTS=\${SOPE_LIBDIR}/SoProducts-\${MAJOR_VERSION}.\${MINOR_VERSION}"
cfgwrite "SOPE_SAXDRIVERS=\${SOPE_LIBDIR}/SaxDrivers-\${MAJOR_VERSION}.\${MINOR_VERSION}"
cfgwrite "SOPE_NGOBJWEB=\${GNUSTEP_RESOURCES}/NGObjWeb"
cfgwrite "SOPE_WOXBUILDERS=\${GNUSTEP_LIBRARY}/WOxElemBuilders-\${MAJOR_VERSION}.\${MINOR_VERSION}"
cfgwrite "SOPE_SAXMAPPINGS=\${GNUSTEP_LIBRARY}/SaxMappings"
cfgwrite "SOPE_TOOLS=\${GNUSTEP_TOOLS}"
cfgwrite "SOPE_ADMIN_TOOLS=\${GNUSTEP_ADMIN_TOOLS}"
fi
if test $ARG_WITH_DEBUG = 1; then
cfgwrite "# configured to produce debugging code";
cfgwrite "debug:=yes"
else
cfgwrite "# configured to produce non-debugging code";
cfgwrite "debug:=no"
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 "# GNUstep environment variables:";
for i in `env | grep ^GNUSTEP_ | sort`; do
MAKE_ASSI="`echo $i | sed s/=/:=/`"
cfgwrite "${MAKE_ASSI}";
done
cfgwrite "LIBRARY_COMBO=$LIBRARY_COMBO"
cfgwrite "include \${SOPE_ROOT}/general.make"
cfgwrite ""
}
checkLinking() {
# library-name => $1, type => $2
local oldpwd="${PWD}"
local tmpdir=".configure-test-$$"
mkdir $tmpdir
cd $tmpdir
cp ../maintenance/dummytool.c .
OLDLIBS=$LIBS
for LIB in $1;do
LIBS="$LIBS -l${LIB}"
done
tmpmake="GNUmakefile"
echo >$tmpmake "-include ../config.make"
echo >>$tmpmake "include \$(GNUSTEP_MAKEFILES)/common.make"
echo >>$tmpmake "CTOOL_NAME := linktest"
echo >>$tmpmake "linktest_C_FILES := dummytool.c"
echo >>$tmpmake "ifeq (\$(findstring openbsd, \$(GNUSTEP_HOST_OS)), openbsd)"
echo >>$tmpmake "linktest_TOOL_LIBS += $LIBS -liconv"
echo >>$tmpmake "else"
echo >>$tmpmake "linktest_TOOL_LIBS += $LIBS"
echo >>$tmpmake "endif"
echo >>$tmpmake "SYSTEM_LIB_DIR += \$(CONFIGURE_SYSTEM_LIB_DIR)"
echo >>$tmpmake "SYSTEM_LIB_DIR += ${LINK_SYSLIBDIRS}"
echo >>$tmpmake "include \$(GNUSTEP_MAKEFILES)/ctool.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"
cfgwrite "HAS_LIBRARY_$1=yes"
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"
cfgwrite "HAS_LIBRARY_$1=no"
LIBS=$OLDLIBS
fi
fi
cd "${oldpwd}"
rm -rf $tmpdir
return $LINK_RESULT
}
checkDependencies() {
cfgwrite ""
cfgwrite "# library dependencies"
cfgwrite "BASE_LIBS := `gnustep-config --base-libs`"
if test "x$ARG_WITH_XML" = "xauto" ; then
checkLinking "xml2" optional;
elif test $ARG_WITH_XML = 1 ; then
checkLinking "xml2" required;
else
cfgwrite "HAS_LIBRARY_xml2=no"
fi
if test "x$ARG_WITH_OPENLDAP" = "xauto" ; then
checkLinking "ldap" optional;
elif test $ARG_WITH_OPENLDAP = 1 ; then
checkLinking "ldap" required;
else
cfgwrite "HAS_LIBRARY_ldap=no"
fi
if test "x$ARG_CFGSSL" = "xauto"; then
checkLinking "ssl" optional;
if test $? != 0; then
checkLinking "gnutls" optional;
fi;
elif test "x$ARG_CFGSSL" = "xssl"; then
checkLinking "ssl" required;
elif test "x$ARG_CFGSSL" = "xgnutls"; then
checkLinking "gnutls" required;
fi
if test "x$ARG_CABUNDLE" = "xauto"; then
while read f; do
if test -f $f; then
echo "found $f"
ARG_CABUNDLE="$f"
break
fi
# we need this odd syntax in order not to spawn a sub
# shell
done << EOF
/etc/ssl/certs/ca-certificates.crt
/etc/pki/tls/certs/ca-bundle.crt
/usr/share/ssl/certs/ca-bundle.crt
/usr/local/share/certs/ca-root-nss.crt
/etc/ssl/cert.pem
EOF
if test "x$ARG_CABUNDLE" = "xauto"; then
echo "failed to find CA root store"
exit 1
fi
fi
if test "x$ARG_CABUNDLE" != "xnone"; then
cfgwrite "CA_BUNDLE=$ARG_CABUNDLE"
echo "Using CA Bundle: $ARG_CABUNDLE"
fi
if test "x$ARG_WITH_POSTGRESQL" = "xauto" ; then
checkLinking "pq" optional;
elif test $ARG_WITH_POSTGRESQL = 1 ; then
checkLinking "pq" required;
else
cfgwrite "HAS_LIBRARY_pq=no"
fi
# checkLinking "sqlite3" optional;
cfgwrite "HAS_LIBRARY_sqlite3=no"
if test "x$ARG_WITH_MYSQL" = "xauto" ; then
checkLinking "mysqlclient" optional;
elif test $ARG_WITH_MYSQL = 1 ; then
checkLinking "mysqlclient" required;
else
cfgwrite "HAS_LIBRARY_mysqlclient=no"
fi
}
runIt() {
if test $ARG_BEQUIET != 1; then
printParas;
fi
if test $ARG_NOCREATE = 1; then
if test $ARG_BEQUIET != 1; then
echo "not creating the config file ...";
fi
else
genConfigMake;
checkDependencies;
if test -x "${NGSTREAMS_DIR}/configure"; then
if test $ARG_BEQUIET != 1; then
echo -n "configuring NGStreams library .."
old="$PWD"
cd "${NGSTREAMS_DIR}"
./configure >"${old}/config-NGStreams.log"
cd "${old}"
echo ".. done (log in config-NGStreams.log)."
fi
fi
fi
}
# ******************** options ********************
extractFuncValue() {
VALUE="`echo "$1" | sed "s/[^=]*=//g"`"
}
processOption() {
case "x$1" in
"x--help"|"x-h")
usage;
;;
"x--quiet"|"x--silent"|"x-q") ARG_BEQUIET=1; ;;
"x--no-create"|"x-n") ARG_NOCREATE=1; ;;
x--prefix=*)
extractFuncValue $1;
ARG_PREFIX="$VALUE";
;;
x--frameworks=*)
extractFuncValue $1;
ARG_FRAMEWORK_DIR="$VALUE";
;;
x--gsmake=*)
extractFuncValue $1;
ARG_GSMAKE="$VALUE";
;;
x--configmake=*)
extractFuncValue $1;
ARG_CFGMAKE="$VALUE";
;;
"x--with-gnustep")
ARG_WITH_GNUSTEP=1
DARG_IS_FHS=0
;;
"x--without-gnustep")
ARG_WITH_GNUSTEP=0
DARG_IS_FHS=1
;;
"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
;;
x--with-ssl=*)
extractFuncValue $1;
ARG_CFGSSL="$VALUE"
;;
x--ca-bundle=*)
extractFuncValue $1;
ARG_CABUNDLE="$VALUE"
;;
"x--enable-mysql")
ARG_WITH_MYSQL=1
;;
"x--enable-postgresql")
ARG_WITH_POSTGRESQL=1
;;
"x--enable-openldap")
ARG_WITH_OPENLDAP=1
;;
"x--enable-xml")
ARG_WITH_XML=1
;;
"x--disable-mysql")
ARG_WITH_MYSQL=0
;;
"x--disable-postgresql")
ARG_WITH_POSTGRESQL=0
;;
"x--disable-openldap")
ARG_WITH_OPENLDAP=0
;;
"x--disable-xml")
ARG_WITH_XML=0
;;
*) echo "error: cannot process argument: $1"; exit 1; ;;
esac
}
for i in $@; do
processOption $i;
done
# load GNUstep environment
validateGNUstepArgs
# first we load the GNUstep.sh environment
. $DARG_GNUSTEP_SH
if test $ARG_BEQUIET != 1; then
printGNUstepSetup;
fi
# setup some GNUstep dependend defaults
if test "x$GNUSTEP_HOST_VENDOR" = "xapple"; then
setupAppleArgs;
fi
# ensure the parameters make sense
validateArgs
# start it
runIt
|