andre@0: #!/bin/sh andre@0: # Copyright (c) 2011 The Chromium Authors. All rights reserved. andre@0: # Use of this source code is governed by a BSD-style license that can be andre@0: # found in the LICENSE file. andre@0: andre@0: # This shell script checks out the NSPR source tree from CVS and prepares andre@0: # it for Chromium. andre@0: andre@0: # Make the script exit as soon as something fails. andre@0: set -ex andre@0: andre@0: rm -rf nspr andre@0: hg clone -u NSPR_4_10_4_RTM https://hg.mozilla.org/projects/nspr andre@0: andre@0: rm -r nspr/admin andre@0: rm -r nspr/build andre@0: rm -r nspr/config andre@0: rm -r nspr/lib/prstreams andre@0: rm -r nspr/lib/tests andre@0: rm -r nspr/pkg andre@0: rm -r nspr/pr/src/cplus andre@0: rm -r nspr/pr/tests andre@0: rm -r nspr/tools andre@0: andre@0: # Remove unneeded platform-specific directories. andre@0: rm -r nspr/pr/src/bthreads andre@0: rm -r nspr/pr/src/md/beos andre@0: rm -r nspr/pr/src/md/os2 andre@0: andre@0: find nspr -name .cvsignore -print | xargs rm andre@0: find nspr -name README -print | xargs rm andre@0: andre@0: # Remove the build system. andre@0: rm nspr/aclocal.m4 andre@0: rm nspr/configure andre@0: rm nspr/configure.in andre@0: find nspr -name Makefile.in -print | xargs rm andre@0: find nspr -name "*.mk" -print | xargs rm andre@0: andre@0: # Remove files for building shared libraries/DLLs. andre@0: find nspr -name "*.def" -print | xargs rm andre@0: find nspr -name "*.rc" -print | xargs rm andre@0: find nspr -name prvrsion.c -print | xargs rm andre@0: find nspr -name plvrsion.c -print | xargs rm andre@0: andre@0: # Remove unneeded platform-specific files in nspr/pr/include/md. andre@0: find nspr/pr/include/md -name "_*" ! -name "_darwin.*" \ andre@0: ! -name "_linux.*" ! -name "_win95.*" ! -name _pth.h ! -name _pcos.h \ andre@0: ! -name _unixos.h ! -name _unix_errors.h ! -name _win32_errors.h -print \ andre@0: | xargs rm andre@0: andre@0: # Remove files for unneeded Unix flavors. andre@0: find nspr/pr/src/md/unix -type f ! -name "ux*.c" ! -name unix.c \ andre@0: ! -name unix_errors.c ! -name darwin.c ! -name "os_Darwin*.s" \ andre@0: ! -name linux.c ! -name "os_Linux*.s" -print \ andre@0: | xargs rm andre@0: rm nspr/pr/src/md/unix/os_Darwin_ppc.s andre@0: rm nspr/pr/src/md/unix/os_Linux_ppc.s andre@0: rm nspr/pr/src/md/unix/os_Linux_ia64.s andre@0: rm nspr/pr/src/md/unix/uxpoll.c andre@0: andre@0: # Remove files for the WINNT build configuration. andre@0: rm nspr/pr/src/md/windows/ntdllmn.c andre@0: rm nspr/pr/src/md/windows/ntio.c andre@0: rm nspr/pr/src/md/windows/ntthread.c andre@0: andre@0: # Remove obsolete files or files we don't need. andre@0: rm nspr/pr/include/gencfg.c andre@0: rm nspr/pr/src/misc/compile-et.pl andre@0: rm nspr/pr/src/misc/dtoa.c andre@0: rm nspr/pr/src/misc/prerr.et andre@0: rm nspr/pr/src/misc/prerr.properties