diff options
author | Benny Prijono <bennylp@teluu.com> | 2005-11-07 19:57:09 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2005-11-07 19:57:09 +0000 |
commit | ecbfea041853572df17429f9fb90d4e700ca472d (patch) | |
tree | afac9f95edf9e37e18c4da02f135c1d40e9a2b41 | |
parent | 86d952cbd59cf37055f31a898758a9c8b105dad2 (diff) |
Added simple configure script
git-svn-id: http://svn.pjsip.org/repos/pjproject/main@22 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | build.mak.txt (renamed from build.mak) | 5 | ||||
-rwxr-xr-x | configure | 63 |
2 files changed, 67 insertions, 1 deletions
diff --git a/build.mak b/build.mak.txt index bc5777e6..93c30ec1 100644 --- a/build.mak +++ b/build.mak.txt @@ -2,11 +2,13 @@ # # MACHINE_NAME values: # - i386 (generic x86) -# - m68k +# - sparc +# - alpha # # OS_NAME values: # - win32 (generic windows) # - linux +# - sunos # # CC_NAME values: # - gcc @@ -15,6 +17,7 @@ # HOST_NAME values: # - win32 (Windows command line) # - mingw (Windows, mingw) +# - unix # # diff --git a/configure b/configure new file mode 100755 index 00000000..658eca3b --- /dev/null +++ b/configure @@ -0,0 +1,63 @@ +#!/bin/sh + +# +# Detect machine +# +MACHINE=`uname -m` + +if echo $MACHINE | grep sun4u > /dev/null; then + MACHINE_NAME=sparc +elif echo $MACHINE | grep i.86 > /dev/null; then + MACHINE_NAME=i386 +elif echo $MACHINE | grep alpha > /dev/null; then + MACHINE_NAME=alpha +else + echo "Unable to detect processor type ('uname -m' == '$MACHINE')" + exit 1 +fi + +# +# Detect OS and host +# +SYSTEM=`uname -s` + +if echo $SYSTEM | grep -i sunos > /dev/null; then + OS_NAME=sunos + HOST_NAME=unix +elif echo $SYSTEM | grep -i linux > /dev/null; then + OS_NAME=linux + HOST_NAME=unix +elif echo $SYSTEM | grep -i mingw > /dev/null; then + OS_NAME=win32 + HOST_NAME=mingw +elif echo $SYSTEM | grep -i cygwin > /dev/null; then + OS_NAME=win32 + HOST_NAME=mingw +else + echo "Unable to detect system type ('uname -s' == '$SYSTEM')" + exit 1 +fi + +# +# Detect gcc +# +if gcc --version 2>&1 > /dev/null; then + CC_NAME=gcc +else + echo "Unable to find gcc" + exit 1 +fi + +echo 'Writing build.mak as follows:' +echo " MACHINE_NAME=$MACHINE_NAME" +echo " OS_NAME=$OS_NAME" +echo " HOST_NAME=$HOST_NAME" +echo " CC_NAME=$CC_NAME" + +echo "# Auto-generated build.mak" > build.mak +echo "export MACHINE_NAME := $MACHINE_NAME" >> build.mak +echo "export OS_NAME := $OS_NAME" >> build.mak +echo "export HOST_NAME := $HOST_NAME" >> build.mak +echo "export CC_NAME := $CC_NAME" >> build.mak +echo "Done." + |