Selaa lähdekoodia

Add configure scripts

pull/211/head
ncshaw 3 vuotta sitten
vanhempi
commit
afd7c2b3a2
6 muutettua tiedostoa jossa 89 lisäystä ja 3 poistoa
  1. +1
    -0
      .gitignore
  2. +6
    -1
      Makefile
  3. +41
    -0
      configure
  4. +39
    -0
      configure.ps1
  5. BIN
      rebar
  6. +2
    -2
      rebar.config

+ 1
- 0
.gitignore Näytä tiedosto

@ -7,6 +7,7 @@
*.d
*.o
*.so
bin
_build
compile_commands.json
deps

+ 6
- 1
Makefile Näytä tiedosto

@ -1,4 +1,4 @@
REBAR?=./rebar
REBAR?=bin/rebar
all: build
@ -16,6 +16,11 @@ distclean: clean
build:
ifeq ($(OS),Windows_NT)
./configure.bat
else
./configure
endif
$(REBAR) compile

+ 41
- 0
configure Näytä tiedosto

@ -0,0 +1,41 @@
rootdir="$(cd "${0%/*}" 2>/dev/null; echo "$PWD")"
install_local_rebar() {
if [ ! -x "${rootdir}/bin/rebar" ]; then
if [ ! -d "${rootdir}/src/rebar" ]; then
git clone --depth 1 https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar
fi
make -C ${rootdir}/src/rebar
if [ ! -d "${rootdir}/bin/" ]; then
mkdir ${rootdir}/bin/
fi
mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar
make -C ${rootdir}/src/rebar clean
rm -rf ${rootdir}/src/rebar
fi
}
install_local_enc() {
if [ ! -x "${rootdir}/bin/enc" ]; then
if [ ! -d "${rootdir}/src/erlang-native-compiler" ]; then
git clone --depth 1 https://github.com/davisp/erlang-native-compiler.git ${rootdir}/src/erlang-native-compiler
fi
make -C ${rootdir}/src/erlang-native-compiler
if [ ! -d "${rootdir}/bin/" ]; then
mkdir ${rootdir}/bin/
fi
mv ${rootdir}/src/erlang-native-compiler/enc ${rootdir}/bin/enc
make -C ${rootdir}/src/erlang-native-compiler clean
rm -rf ${rootdir}/src/erlang-native-compiler
fi
}
if [ -z "${REBAR}" ]; then
install_local_rebar
REBAR=${rootdir}/bin/rebar
fi
if [ -z "${ENC}" ]; then
install_local_enc
ENC=${rootdir}/bin/enc
fi

+ 39
- 0
configure.ps1 Näytä tiedosto

@ -0,0 +1,39 @@
$rootdir = split-path -parent $MyInvocation.MyCommand.Definition
Push-Location $rootdir
[Environment]::CurrentDirectory = $PWD
if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null)
{
if (-Not (Test-Path "src\rebar"))
{
git clone --depth 1 https://github.com/apache/couchdb-rebar.git $rootdir\src\rebar
}
cmd /c "cd src\rebar && $rootdir\src\rebar\bootstrap.bat"
if (-Not (Test-Path "bin"))
{
mkdir $rootdir\bin
}
cp $rootdir\src\rebar\rebar $rootdir\bin\rebar
cp $rootdir\src\rebar\rebar.cmd $rootdir\bin\rebar.cmd
make -C $rootdir\src\rebar clean
rmdir $rootdir\src\rebar
$env:Path += ";$rootdir\bin"
}
if ((Get-Command "enc.cmd" -ErrorAction SilentlyContinue) -eq $null)
{
if (-Not (Test-Path "bin"))
{
git clone --depth 1 https://github.com/davisp/erlang-native-compiler.git $rootdir\src\erlang-native-compiler
}
cmd /c "cd src\erlang-native-compiler && $rootdir\src\erlang-native-compiler\bootstrap.bat"
if (-Not (Test-Path "bin"))
{
mkdir $rootdir\bin
}
cp $rootdir\src\erlang-native-compiler\enc $rootdir\bin\enc
cp $rootdir\src\erlang-native-compiler\enc.cmd $rootdir\bin\enc.cmd
make -C $rootdir\src\erlang-native-compiler clean
rmdir $rootdir\src\erlang-native-compiler
$env:Path += ";$rootdir\bin"
}

BIN
rebar Näytä tiedosto


+ 2
- 2
rebar.config Näytä tiedosto

@ -36,5 +36,5 @@
verbose
]}.
{pre_hooks, [{"", compile, "escript enc compile"}]}.
{post_hooks, [{"", clean, "escript enc clean"}]}.
{pre_hooks, [{"", compile, "escript bin/enc compile"}]}.
{post_hooks, [{"", clean, "escript bin/enc clean"}]}.

Ladataan…
Peruuta
Tallenna