~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to otp_build

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    echo "release [-a] <target_dir> - creates full release to <target_dir>"
34
34
    echo "tests <dir> - Build testsuites to <dir>"
35
35
    echo ""
 
36
    echo "remove_prebuilt_files - create a minimal source tree"
 
37
    echo "save_bootstrap - recreate primary bootstrap"
 
38
    echo ""
36
39
    echo "debuginfo_win32 <dir> - adds debug emulator and pdb files to <dir>"
37
40
    echo "installer_win32 <dir> - creates a windows installer from <dir>" 
38
41
    echo ""
680
683
    (cd $installer_dir; $MAKE MAKE="$MAKE" TARGET=$TARGET TESTROOT=$1 release) || exit 1
681
684
}
682
685
 
 
686
do_copy_primary_bootstrap ()
 
687
{
 
688
    if [ "x$1" = "x" ]; then
 
689
        echo "Missing bootstrap source top" 1>&2
 
690
        exit 1
 
691
    fi
 
692
    if  [ ! -d $1 ]; then
 
693
        echo "Invalid bootstrap source top" 1>&2
 
694
        exit 1
 
695
    fi
 
696
    if [ "x$2" = "x" ]; then
 
697
        echo "Missing bootstrap root" 1>&2
 
698
        exit 1
 
699
    fi
 
700
    if  [ ! -d $2 ]; then
 
701
        echo "Invalid bootstrap root" 1>&2
 
702
        exit 1
 
703
    fi
 
704
 
 
705
    bootstrap=$2/bootstrap
 
706
    bootstrap_src_top=$1
 
707
    lib_src=$bootstrap_src_top/lib
 
708
 
 
709
    # kernel
 
710
    test -d $bootstrap/lib/kernel/ebin || mkdir -p  $bootstrap/lib/kernel/ebin
 
711
    test -d $bootstrap/lib/kernel/include || mkdir -p  $bootstrap/lib/kernel/include
 
712
    cp -f $lib_src/kernel/ebin/*.beam $bootstrap/lib/kernel/ebin
 
713
    cp -f $lib_src/kernel/ebin/*.app* $bootstrap/lib/kernel/ebin
 
714
    cp -f $lib_src/kernel/include/*.hrl $bootstrap/lib/kernel/include
 
715
 
 
716
    # stdlib
 
717
    test -d $bootstrap/lib/stdlib/ebin || mkdir -p  $bootstrap/lib/stdlib/ebin
 
718
    test -d $bootstrap/lib/stdlib/include || mkdir -p  $bootstrap/lib/stdlib/include
 
719
    cp -f $lib_src/stdlib/ebin/*.beam $bootstrap/lib/stdlib/ebin
 
720
    cp -f $lib_src/stdlib/ebin/*.app* $bootstrap/lib/stdlib/ebin
 
721
    cp -f $lib_src/stdlib/include/*.hrl $bootstrap/lib/stdlib/include
 
722
 
 
723
    # compiler
 
724
    test -d $bootstrap/lib/compiler/ebin || mkdir -p  $bootstrap/lib/compiler/ebin
 
725
    cp -f $lib_src/compiler/ebin/*.beam $bootstrap/lib/compiler/ebin
 
726
    cp -f $lib_src/compiler/ebin/*.app* $bootstrap/lib/compiler/ebin
 
727
 
 
728
    # orber include
 
729
    test -d $bootstrap/lib/orber/include || mkdir -p  $bootstrap/lib/orber/include
 
730
    cp -f $lib_src/orber/include/* $bootstrap/lib/orber/include
 
731
 
 
732
    # bootstrap bin
 
733
    if [ $bootstrap_src_top != $ERL_TOP ]; then
 
734
        test -d $bootstrap/bin || mkdir -p  $bootstrap/bin
 
735
        cp -f $bootstrap_src_top/bin/* $bootstrap/bin
 
736
    fi
 
737
 
 
738
}
 
739
 
 
740
do_save_bootstrap ()
 
741
{
 
742
    if [ ! -f $ERL_TOP/prebuilt.files ]; then
 
743
        echo "This is not a pre-built source distribution" 1>&2
 
744
        exit 1
 
745
    fi
 
746
    if  [ -d $ERL_TOP/bootstrap/lib ]; then
 
747
        echo "Bootstrap already exist" 1>&2
 
748
        exit 1
 
749
    fi
 
750
 
 
751
    do_copy_primary_bootstrap $ERL_TOP $ERL_TOP
 
752
}
 
753
 
 
754
do_remove_prebuilt_files ()
 
755
{
 
756
    do_save_bootstrap
 
757
    for file in $ERL_TOP/`cat $ERL_TOP/prebuilt.files` ; do
 
758
        rm -f $file
 
759
    done
 
760
}
 
761
 
683
762
# main
684
763
 
685
764
check_erltop
752
831
                shift;
753
832
                if [ $minus_a_flag = true ]; then 
754
833
                    shift
755
 
                else
756
 
                    TYPE=opt
757
834
                fi;
758
 
                FLAVOR=plain
759
835
                do_autoconf; 
760
836
                do_configure "$@";
761
837
                do_noboot_lib_and_erts;;
762
838
        lazy_setup)
763
839
                shift;
764
 
                if [ $minus_a_flag = true ]; then
 
840
                if [ $minus_a_flag = true ]; then 
765
841
                    shift
766
 
                else
767
 
                    TYPE=opt
768
842
                fi;
769
 
                FLAVOR=plain
770
843
                do_lazy_configure "$@";
771
844
                do_noboot_lib_and_erts;;
772
845
        autoconf)
783
856
        lazy_configure_target_clean)
784
857
                shift;
785
858
                do_lazy_configure_target_clean;;
786
 
        opt|plain|smp|hybrid|nofrag)
 
859
        opt)
 
860
                do_noboot_lib_and_erts;;
 
861
        plain|smp|hybrid|nofrag)
787
862
                if [ $minus_a_flag = false ]; then 
788
863
                    TYPE=opt
789
864
                fi;
808
883
                    shift
809
884
                fi;
810
885
                do_tests "$2";;
 
886
        remove_prebuilt_files)
 
887
                do_remove_prebuilt_files;;
 
888
        save_bootstrap)
 
889
                do_save_bootstrap;;
 
890
        copy_primary_bootstrap)
 
891
                do_copy_primary_bootstrap $2 $3;;
811
892
        installer_win32)
812
893
                if [ $minus_a_flag = true ]; then 
813
894
                    shift