lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] git commit: Add sample configure scripts
Date Mon, 17 Mar 2014 22:24:51 GMT
Repository: lucy-charmonizer
Updated Branches:
  refs/heads/master c491b2ac8 -> 0b1d7eb68


Add sample configure scripts


Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/0b1d7eb6
Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/0b1d7eb6
Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/0b1d7eb6

Branch: refs/heads/master
Commit: 0b1d7eb68e200da075f0cbe643eec9873981edb2
Parents: c491b2a
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Mar 17 23:22:10 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Mar 17 23:24:18 2014 +0100

----------------------------------------------------------------------
 samples/configure     | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 samples/configure.bat | 46 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/0b1d7eb6/samples/configure
----------------------------------------------------------------------
diff --git a/samples/configure b/samples/configure
new file mode 100755
index 0000000..ba1281f
--- /dev/null
+++ b/samples/configure
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+probe_clang() { clang -v; }
+probe_gcc()   { gcc -v; }
+
+if [ -z "$CC" ]; then
+    case $(uname) in
+        Darwin*) compilers="clang gcc";;
+        *)       compilers="gcc clang";;
+    esac
+
+    for compiler in $compilers; do
+        if probe_$compiler >/dev/null 2>&1; then
+            CC=$compiler
+            break
+        fi
+    done
+
+    if [ -z "$CC" ]; then
+        CC=cc
+    fi
+fi
+
+echo "Using C compiler '$CC'"
+
+command="$CC charmonizer.c -o charmonizer"
+echo $command
+$command || exit
+
+echo Running charmonizer
+./charmonizer --cc=$CC --enable-c --enable-makefile "$@"
+

http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/0b1d7eb6/samples/configure.bat
----------------------------------------------------------------------
diff --git a/samples/configure.bat b/samples/configure.bat
new file mode 100644
index 0000000..cf65d36
--- /dev/null
+++ b/samples/configure.bat
@@ -0,0 +1,46 @@
+@echo off
+
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+setlocal
+set CL=
+cl >nul 2>nul
+endlocal
+if not errorlevel 1 goto found_cl
+
+gcc -v >nul 2>nul
+if not errorlevel 1 goto found_gcc
+
+echo No C compiler found
+exit /b 1
+
+:found_cl
+echo Using C compiler 'cl'
+echo cl /nologo charmonizer.c
+cl /nologo charmonizer.c
+if errorlevel 1 exit /b 1
+echo Running charmonizer
+charmonizer.exe --cc=cl --enable-c --enable-makefile %*
+exit /b
+
+:found_gcc
+echo Using C compiler 'gcc'
+echo gcc charmonizer.c -o charmonizer.exe
+gcc charmonizer.c -o charmonizer.exe
+if errorlevel 1 exit /b 1
+echo Running charmonizer
+charmonizer.exe --cc=gcc --enable-c --enable-makefile %*
+exit /b


Mime
View raw message