[darwinbuild-changes] [425] trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Dec 2 14:01:47 PST 2008
Revision: 425
http://trac.macosforge.org/projects/darwinbuild/changeset/425
Author: wsiegrist at apple.com
Date: 2008-12-02 14:01:46 -0800 (Tue, 02 Dec 2008)
Log Message:
-----------
Add Ben Huntsman's support for xcode's configuration parameter
Modified Paths:
--------------
trunk/darwinbuild/darwinbuild
Added Paths:
-----------
trunk/darwinxref/plugins/configuration.c
Modified: trunk/darwinbuild/darwinbuild
===================================================================
--- trunk/darwinbuild/darwinbuild 2008-11-22 01:05:53 UTC (rev 424)
+++ trunk/darwinbuild/darwinbuild 2008-12-02 22:01:46 UTC (rev 425)
@@ -105,6 +105,7 @@
projnam=""
action="install"
target=""
+configuration=""
version=""
###
@@ -167,7 +168,7 @@
function PrintUsage() {
cat <<-EOF 1>&2
usage: $(basename $0) [flags] <project> [<version>]
- usage: flags: [-headers] [-build=X] [-target=X]
+ usage: flags: [-headers] [-build=X] [-target=X] [-configuration=X]
[-logdeps] [-nochroot] [-nopatch] [-noload | -loadonly]
[-depsbuild=X [-depsbuild=Y]]
[-fetch] [-source] [-load]
@@ -221,6 +222,7 @@
### don't build.
### -logdeps Do magic to log the build-time dependencies
### -target=X The makefile or xcode target to build
+### -configuration=X The build configuration to use
### -build=X X is the darwin build number to buld, e.g. 8B15
### -depsbuild=X X is the darwin build number to populate the BuildRoot
### <project> The name of the project to build
@@ -246,6 +248,8 @@
action="source"
elif [ "${ARG/=*/}" == "-target" ]; then
target="${ARG/*=/}"
+ elif [ "${ARG/=*/}" == "-configuration" ]; then
+ configuration="${ARG/*=/}"
elif [ "${ARG/=*/}" == "-build" ]; then
build="${ARG/*=/}"
elif [ "${ARG/=*/}" == "-depsbuild" ]; then
@@ -342,6 +346,13 @@
fi
#
+# Look for an alternate build configuration in the database
+#
+if [ "$configuration" == "" -a "$action" == "install" ]; then
+ configuration=$($DARWINXREF configuration "$projnam")
+fi
+
+#
# Sanity check to make sure we actually have a project to build.
#
if [ "$project" == "" ]; then
@@ -612,6 +623,14 @@
action="$target"
fi
+#
+# append build configuration to $action, if any
+# this is only applicable to xcodebuild
+#
+if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then
+ build_string="$build_string -configuration $configuration"
+fi
+
###
### Write out the build script that will be used.
### This may or may not be executed in a chroot.
Added: trunk/darwinxref/plugins/configuration.c
===================================================================
--- trunk/darwinxref/plugins/configuration.c (rev 0)
+++ trunk/darwinxref/plugins/configuration.c 2008-12-02 22:01:46 UTC (rev 425)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2008 Apple Computer, Inc. All rights reserved.
+ * Portions copyright (c) 2008 Ben Huntsman <BHuntsman at mail2.cu-portland.edu>
+ *
+ * @APPLE_BSD_LICENSE_HEADER_START@
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @APPLE_BSD_LICENSE_HEADER_END@
+ *
+ */
+
+
+/*
+ * Support alternate build configurations, via 'xcodebuild -configuration'
+ * 20081124 - Ben Huntsman <BHuntsman at mail2.cu-portland.edu>
+ */
+
+#include "DBPlugin.h"
+
+int initialize(int version) {
+ //if ( version < kDBPluginCurrentVersion ) return -1;
+
+ DBPluginSetType(kDBPluginProjectPropertyType);
+ DBPluginSetName(CFSTR("configuration"));
+ DBPluginSetRunFunc(&DBPluginPropertyDefaultRun);
+ DBPluginSetUsageFunc(&DBPluginPropertyDefaultUsage);
+ DBPluginSetDataType(CFStringGetTypeID());
+ return 0;
+}
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20081202/bd098646/attachment.html>
More information about the darwinbuild-changes
mailing list