Skip to content

Commit

Permalink
Merge pull request #8 from sl1pkn07/master
Browse files Browse the repository at this point in the history
Normalize configure script
  • Loading branch information
mawen1250 committed Jun 30, 2015
2 parents f27c7e3 + 31e8f55 commit ef42e59
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions configure
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ options:
--install=PATH set dir for install library
[/usr/local/lib/vapoursynth]
--clang, --gcc compile by g++ or clang++ [clang]
--cxx=CXX use a defined compiler for compilation and linking
[g++]
--target-os=OS build programs to run on OS [auto]
--cross-prefix=PREFIX use PREFIX for compilation tools
--sysroot=SYSROOT root of cross-build tree
Expand All @@ -38,6 +39,7 @@ error_exit()
echo error: $1
exit 1
}

log_echo()
{
echo $1
Expand Down Expand Up @@ -79,13 +81,10 @@ TARGET_OS=""
CROSS=""

SYSROOT=""
CXX="clang++"
LD="clang++"
CXX="g++"
LD="g++"
STRIP="strip"

test -n "$(which $CXX 2> /dev/null)" || CXX="g++"
test -n "$(which $LD 2> /dev/null)" || LD="g++"

DEBUG=""

LIBNAME=""
Expand All @@ -107,10 +106,11 @@ for opt; do
;;
--enable-debug)
DEBUG="enabled"
XCXXFLAGS="$XCXXFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
;;
--cxx=*)
CXX="$optarg"
LD="$optarg"
;;
--extra-cxxflags=*)
XCXXFLAGS="$optarg"
Expand All @@ -131,14 +131,6 @@ for opt; do
CXXFLAGS="$CXXFLAGS --sysroot=$optarg"
LDFLAGS="$LDFLAGS --sysroot=$optarg"
;;
--gcc)
CXX="g++"
LD="g++"
;;
--clang)
CXX="clang++"
LD="clang++"
;;
--target=*)
TARGET="-m$optarg"
;;
Expand Down Expand Up @@ -186,8 +178,8 @@ log_echo "CXXFLAGS/LDFLAGS checking..."
if ! cc_check "$CXXFLAGS" "$LDFLAGS"; then
error_exit "invalid CXXFLAGS/LDFLAGS"
fi
if cc_check "-Os -ffast-math $CXXFLAGS" "$LDFLAGS"; then
CXXFLAGS="-Os -ffast-math $CXXFLAGS"
if cc_check "-O2 -ffast-math $CXXFLAGS" "$LDFLAGS"; then
CXXFLAGS="-O2 -ffast-math $CXXFLAGS"
fi
if cc_check "$CXXFLAGS" "$LDFLAGS"; then
CXXFLAGS="$CXXFLAGS"
Expand All @@ -210,6 +202,7 @@ fi

LDFLAGS="$SOFLAGS $LDFLAGS"
LIBS="$LIBS $XLIBS"
CXXFLAGS="$CXXFLAGS $VSCFLAGS"


cat >> config.mak << EOF
Expand Down

0 comments on commit ef42e59

Please sign in to comment.