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