Bug 790517: mtransport import/build for nrappkit/nICEr r=ted
authorEKR <ekr@rtfm.com>
Tue, 02 Oct 2012 10:12:50 -0700
changeset 109672 da39ec3b97783342c892e6a9b8abaedeb372d8fc
parent 109671 5d59f7ecfb16e04e0660240150f66beb917f51b3
child 109673 a8fac69129b0bac8b55e33574f4c4338d494b150
push id84
push usernmatsakis@mozilla.com
push dateThu, 11 Oct 2012 23:26:24 +0000
reviewersted
bugs790517
milestone18.0a1
Bug 790517: mtransport import/build for nrappkit/nICEr r=ted
configure.in
media/mtransport/third_party/Makefile.in
media/mtransport/third_party/import.py
toolkit/toolkit-tiers.mk
--- a/configure.in
+++ b/configure.in
@@ -8889,16 +8889,34 @@ if test -n "$MOZ_WEBRTC"; then
    # Ok to pass some extra -D's that are ignored here
    $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
      $GYP_WEBRTC_OPTIONS \
      --generator-output=${_objdir}/media/webrtc/trunk/testing/ \
      ${srcdir}/media/webrtc/trunk/testing/gtest.gyp
    if test "$?" != 0; then
       AC_MSG_ERROR([failed to generate gtest Makefiles])
    fi
+
+   AC_MSG_RESULT("generating nrappkit Makefiles...")
+   $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium --format=mozmake \
+     $GYP_WEBRTC_OPTIONS \
+     --generator-output=${_objdir}/media/mtransport/third_party/nrappkit \
+     ${srcdir}/media/mtransport/third_party/nrappkit/nrappkit.gyp
+   if test "$?" != 0; then
+      AC_MSG_ERROR([failed to generate nrappkit Makefiles])
+   fi
+
+   AC_MSG_RESULT("generating nICEr Makefiles...")
+   $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium --format=mozmake \
+     $GYP_WEBRTC_OPTIONS \
+     --generator-output=${_objdir}/media/mtransport/third_party/nICEr \
+     ${srcdir}/media/mtransport/third_party/nICEr/nicer.gyp
+   if test "$?" != 0; then
+      AC_MSG_ERROR([failed to generate nICEr Makefiles])
+   fi
 fi
 
 # Generate a JSON config file for unittest harnesses etc to read
 # build configuration details from in a standardized way.
 OS_TARGET=${OS_TARGET} \
 TARGET_CPU=${TARGET_CPU} \
 MOZ_DEBUG=${MOZ_DEBUG} \
 MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} \
new file mode 100644
--- /dev/null
+++ b/media/mtransport/third_party/Makefile.in
@@ -0,0 +1,53 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla code.
+#
+# The Initial Developer of the Original Code is the Mozilla Foundation.
+# Portions created by the Initial Developer are Copyright (C) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#  Chris Pearce <chris@pearce.org.nz>
+#  Eric Rescorla <ekr@rtfm.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+
+DEPTH = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+PARALLEL_DIRS = \
+  nrappkit \
+  nICEr \
+  $(NULL)
+
+NO_SUBMAKEFILES_RULE = 1
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/media/mtransport/third_party/import.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Execute as: /import.py <source-distribution> <target-dir>
+# <target-dir> must have 'IMPORT_FILES' in it
+
+import sys
+import re
+import os
+import shutil
+
+def die(msg):
+    sys.stderr.write('ERROR:' + msg + '\n')
+    sys.exit(1)
+    
+DISTRO = sys.argv[1]
+IMPORT_DIR = sys.argv[2]
+FILES = []
+
+f = open("%s/IMPORT_FILES" % IMPORT_DIR)
+for l in f:
+    l = l.strip()
+    l = l.strip("'")
+    if l.startswith("#"):
+        continue
+    if not l:
+        continue
+    FILES.append(l)
+
+for f in FILES:
+    print f
+    SOURCE_PATH = "%s/%s"%(DISTRO,f)
+    DEST_PATH = "%s/%s"%(IMPORT_DIR,f)
+    if not os.path.exists(SOURCE_PATH):
+        die("%s does not exist"%SOURCE_PATH)
+    if not os.path.exists(os.path.dirname(DEST_PATH)):
+        os.makedirs(os.path.dirname(DEST_PATH))
+    shutil.copyfile(SOURCE_PATH, DEST_PATH)
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -129,18 +129,18 @@ ifdef MOZ_PSM
 tier_platform_dirs += \
   security/build \
   $(NULL)
 endif
 
 ifdef MOZ_WEBRTC
 tier_platform_dirs += \
   media/webrtc \
+  media/mtransport/third_party \
   $(NULL)
-#  media/mtransport/third_party \
 #  media/mtransport/build \
 #  media/mtransport/standalone \
 #
 endif
 
 ifdef MOZ_SPEEX_RESAMPLER
 tier_platform_dirs += \
 		media/libspeex_resampler \