xref: /AOO41X/main/bootstrap.1 (revision c6dedb65bb4f6c53874f76e9916c5b19be04c6b1)
1cdf0e10cSrcweir
2cdf0e10cSrcweir# executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x
3cdf0e10cSrcweir# Use spawn instead of fork when building dmake on cygwin.
4cdf0e10cSrcweirif test "$GUI" = "WNT"; then
5cdf0e10cSrcweir    EXEEXT=".exe"
6cdf0e10cSrcweirelse
7cdf0e10cSrcweir    EXEEXT=""
8cdf0e10cSrcweirfi
9cdf0e10cSrcweirexport EXEEXT
10cdf0e10cSrcweir
11cdf0e10cSrcweirmkdir -p "$SOLARENV/$OUTPATH/bin"
12cdf0e10cSrcweir
13cdf0e10cSrcweir#make sure build.pl is executable
14cdf0e10cSrcweir
15cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/build.pl"
16cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/build_client.pl"
17cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/zipdep.pl"
18cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/gccinstlib.pl"
19cdf0e10cSrcweir
20cdf0e10cSrcweir# fetch or update external tarballs
21cdf0e10cSrcweirif [ "$DO_FETCH_TARBALLS" = "yes" ]; then
22cdf0e10cSrcweir	$SRC_ROOT/fetch_tarballs.sh $SRC_ROOT/ooo.lst
23cdf0e10cSrcweirfi
24fb6b49d1SJürgen Schmidt
25fb6b49d1SJürgen Schmidt# ------------------------------------------------------------------------------
26fb6b49d1SJürgen Schmidt# Build dmake
27fb6b49d1SJürgen Schmidt
28fb6b49d1SJürgen Schmidtif test -n "$DMAKE_URL" -a  ! -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then
29fb6b49d1SJürgen Schmidt
30fb6b49d1SJürgen Schmidt    # Assume that the dmake archive has been downloaded by fetch_tarballs.sh
31fb6b49d1SJürgen Schmidt    # Determine the name of the downloaded file.
32fb6b49d1SJürgen Schmidt    dmake_package_name=`echo $DMAKE_URL | sed "s/^\(.*\/\)//"`
33fb6b49d1SJürgen Schmidt
34fb6b49d1SJürgen Schmidt    tmp_build_dir="$SOLARENV/$OUTPATH/misc/build/"
35fb6b49d1SJürgen Schmidt    echo "making and entering $tmp_build_dir"
36fb6b49d1SJürgen Schmidt    # Clean up any residues from a previous and unsuccessful build.
37fb6b49d1SJürgen Schmidt    rm -rf "$tmp_build_dir"
38fb6b49d1SJürgen Schmidt    mkdir -p "$tmp_build_dir"
39fb6b49d1SJürgen Schmidt    cd "$tmp_build_dir" || exit
40fb6b49d1SJürgen Schmidt
41a6ff3988SAndre Fischer    dmake_full_package_name=$(find $TARFILE_LOCATION -type f -name "*-$dmake_package_name")
42a6ff3988SAndre Fischer    if [ -z "$dmake_full_package_name" ]; then
43a6ff3988SAndre Fischer        echo "can not find the dmake package"
44a6ff3988SAndre Fischer        exit
45a6ff3988SAndre Fischer    fi
46fb6b49d1SJürgen Schmidt    if test "$GUI" = "WNT"; then
47fb6b49d1SJürgen Schmidt        dmake_full_package_name=`cygpath -u "$dmake_full_package_name"`
48fb6b49d1SJürgen Schmidt    fi
49fb6b49d1SJürgen Schmidt    echo "unpacking $dmake_full_package_name"
50fb6b49d1SJürgen Schmidt
51fb6b49d1SJürgen Schmidt    # Unpack it.
52fb6b49d1SJürgen Schmidt    case $dmake_package_name in
53fb6b49d1SJürgen Schmidt        *.tar.gz)
54fb6b49d1SJürgen Schmidt            tar -xzf "$dmake_full_package_name"
55fb6b49d1SJürgen Schmidt            dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.gz\)//"`
56fb6b49d1SJürgen Schmidt            ;;
57fb6b49d1SJürgen Schmidt        *.tgz)
58fb6b49d1SJürgen Schmidt            tar -xzf "$dmake_full_package_name"
59fb6b49d1SJürgen Schmidt            dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tgz\)//"`
60fb6b49d1SJürgen Schmidt            ;;
61fb6b49d1SJürgen Schmidt        *.tar.bz2)
62fb6b49d1SJürgen Schmidt            tar -xjf "$dmake_full_package_name"
63fb6b49d1SJürgen Schmidt            dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.bz2\)//"`
64fb6b49d1SJürgen Schmidt            ;;
65fb6b49d1SJürgen Schmidt        *.zip)
66fb6b49d1SJürgen Schmidt            unzip "$dmake_full_package_name"
67fb6b49d1SJürgen Schmidt            dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.zip\)//"`
68fb6b49d1SJürgen Schmidt            ;;
69fb6b49d1SJürgen Schmidt        *)
70fb6b49d1SJürgen Schmidt            echo "can not unpack the dmake source"
71fb6b49d1SJürgen Schmidt            dmake_directory_name=
72fb6b49d1SJürgen Schmidt            exit 1
73fb6b49d1SJürgen Schmidt            ;;
74fb6b49d1SJürgen Schmidt    esac
75fb6b49d1SJürgen Schmidt
76fb6b49d1SJürgen Schmidt    echo "entering $dmake_directory_name"
77fb6b49d1SJürgen Schmidt    cd "$dmake_directory_name" || exit
78fb6b49d1SJürgen Schmidt
79fb6b49d1SJürgen Schmidt    # Special case! The w32/tcsh build needs CC pointing to the MSVC++ compiler
80fb6b49d1SJürgen Schmidt    # but we need a cygwin/gcc build dmake to understand the posix paths
81fb6b49d1SJürgen Schmidt    if test "$GUI" = "WNT"; then
82fb6b49d1SJürgen Schmidt        CC=""
83fb6b49d1SJürgen Schmidt        CXX=""
84fb6b49d1SJürgen Schmidt        export CC
85fb6b49d1SJürgen Schmidt        export CXX
86fb6b49d1SJürgen Schmidt        DMAKE_CONF="--enable-spawn"
87fb6b49d1SJürgen Schmidt    else
88fb6b49d1SJürgen Schmidt        DMAKE_CONF=""
89fb6b49d1SJürgen Schmidt    fi
90fb6b49d1SJürgen Schmidt
91fb6b49d1SJürgen Schmidt    # For unixy systems
92fb6b49d1SJürgen Schmidt    if test -f "Makefile" ; then
93fb6b49d1SJürgen Schmidt        $GNUMAKE distclean || exit
94fb6b49d1SJürgen Schmidt    fi
95fb6b49d1SJürgen Schmidt
96fb6b49d1SJürgen Schmidt    ./configure $DMAKE_CONF || exit
97fb6b49d1SJürgen Schmidt
98fb6b49d1SJürgen Schmidt    ## invoke the gnu make command set by configure.
99fb6b49d1SJürgen Schmidt    $GNUMAKE || exit
100fb6b49d1SJürgen Schmidt
101fb6b49d1SJürgen Schmidt
102fb6b49d1SJürgen Schmidt    # Deploy the dmake executable to solenv
103fb6b49d1SJürgen Schmidt    cp -f "$tmp_build_dir/$dmake_directory_name/dmake$EXEEXT" "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT" || exit
104fb6b49d1SJürgen Schmidt    echo ""
105fb6b49d1SJürgen Schmidt    echo "dmake successfully built and copied to $SOLARENV/$OUTPATH/bin/dmake$EXEEXT"
106fb6b49d1SJürgen Schmidt    echo ""
107fb6b49d1SJürgen Schmidt
108fb6b49d1SJürgen Schmidt    # Clean up.  Note that this is skipped when one of the exits is executed above.
109fb6b49d1SJürgen Schmidt    rm -rf "$tmp_build_dir"
110fb6b49d1SJürgen Schmidt
111aee29faaSAriel Constenla-Haileelif test "$IS_SYSTEM_DMAKE" = "YES"; then
112aee29faaSAriel Constenla-Haile
113aee29faaSAriel Constenla-Haile    echo ""
114aee29faaSAriel Constenla-Haile    echo "dmake is located in search path"
115aee29faaSAriel Constenla-Haile    echo ""
116aee29faaSAriel Constenla-Haile
117aee29faaSAriel Constenla-Haileelif test -n "$DMAKE_PATH" -a -x "$DMAKE_PATH" -a  ! -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then
118aee29faaSAriel Constenla-Haile
119aee29faaSAriel Constenla-Haile    cp -f "$DMAKE_PATH" "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT" || exit
120aee29faaSAriel Constenla-Haile
121aee29faaSAriel Constenla-Haile    echo ""
122aee29faaSAriel Constenla-Haile    echo "dmake copied to $SOLARENV/$OUTPATH/bin/dmake$EXEEXT"
123aee29faaSAriel Constenla-Haile    echo ""
124aee29faaSAriel Constenla-Haile
125fb6b49d1SJürgen Schmidtelse
126fb6b49d1SJürgen Schmidt
127fb6b49d1SJürgen Schmidt    if test -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then
128fb6b49d1SJürgen Schmidt        echo ""
129fb6b49d1SJürgen Schmidt        echo "dmake present in $SOLARENV/$OUTPATH/bin/dmake$EXEEXT"
130fb6b49d1SJürgen Schmidt    fi
131fb6b49d1SJürgen Schmidt
132fb6b49d1SJürgen Schmidtfi
133*c6dedb65SAndre Fischer
134*c6dedb65SAndre Fischer# Download missing extensions.
135*c6dedb65SAndre Fischerdownload_missing_extensions.pl
136