summaryrefslogtreecommitdiff
path: root/configure-legacy
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-09-10 22:31:47 +0000
committerBenny Prijono <bennylp@teluu.com>2006-09-10 22:31:47 +0000
commit6f8bd984d7237a2c53efb3742926012e13f0ae63 (patch)
treec1748fb4d48c8798ba5e773185adbe8119c3c219 /configure-legacy
parent390c76c0e5bdb04d35b7dda078b381cb15b090d2 (diff)
Renamed configure to configure-legacy
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@701 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'configure-legacy')
-rwxr-xr-xconfigure-legacy121
1 files changed, 121 insertions, 0 deletions
diff --git a/configure-legacy b/configure-legacy
new file mode 100755
index 00000000..4e16315e
--- /dev/null
+++ b/configure-legacy
@@ -0,0 +1,121 @@
+#!/bin/sh
+
+#
+# Detect machine, unless the choice has been made already.
+#
+if [ "$MACHINE" = "" ]; then
+ MACHINE=`uname -m`
+fi
+
+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 x86_64 > /dev/null; then
+ MACHINE_NAME=x86_64
+elif echo $MACHINE | grep alpha > /dev/null; then
+ MACHINE_NAME=alpha
+elif echo $MACHINE | grep Mac > /dev/null; then
+ MACHINE_NAME=powerpc
+else
+ echo "Unable to detect processor type ('uname -m' == '$MACHINE')"
+ exit 1
+fi
+
+#
+# Detect OS and host, unless the choice has been made already
+#
+if [ "$SYSTEM" = "" ]; then
+ SYSTEM=`uname -s`
+fi
+
+
+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
+ # More on linux version
+ KERNEL_VER=`uname -r`
+ if echo $KERNEL_VER | grep '^2\.4' > /dev/null; then
+ LINUX_POLL=select
+ elif echo $KERNEL_VER | grep '^2\.2' > /dev/null; then
+ LINUX_POLL=select
+ elif echo $KERNEL_VER | grep '^2\.0' > /dev/null; then
+ LINUX_EPOLL=select
+ else
+# LINUX_POLL=epoll
+ LINUX_POLL=select
+ fi
+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
+elif echo $SYSTEM | grep -i darwin > /dev/null; then
+ OS_NAME=darwinos
+ HOST_NAME=unix
+elif echo $SYSTEM | grep -i rtems > /dev/null; then
+ OS_NAME=rtems
+ HOST_NAME=unix
+else
+ echo "Unable to detect system type ('uname -s' == '$SYSTEM')"
+ exit 1
+fi
+
+#
+# Detect gcc, unless it has been chosen already
+#
+if [ "$CC_NAME" = "" ]; then
+ if gcc --version 2>&1 > /dev/null; then
+ CC_NAME=gcc
+ else
+ echo "Unable to find gcc"
+ exit 1
+ fi
+fi
+
+
+#
+# Specify TARGET_NAME, if not already choosen.
+#
+if [ "$TARGET_NAME" = "" ]; then
+ TARGET_NAME=$MACHINE_NAME-$OS_NAME-$CC_NAME
+fi
+
+
+if test -f build.mak; then
+ echo 'Saving build.mak --> build.mak.old'
+ cp -f build.mak build.mak.old
+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 " TARGET_NAME = $TARGET_NAME"
+echo " CROSS_COMPILE= $CROSS_COMPILE"
+echo " LINUX_POLL = $LINUX_POLL"
+
+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 "export TARGET_NAME := $TARGET_NAME" >> build.mak
+echo "export CROSS_COMPILE := $CROSS_COMPILE" >> build.mak
+echo "export LINUX_POLL := $LINUX_POLL" >> build.mak
+
+touch user.mak
+
+echo
+echo "The configuration for current host has been written to 'build.mak'."
+echo "Customizations can be put in:"
+echo " - 'user.mak'"
+echo " - 'pjlib/include/pj/config_site.h'"
+echo
+echo "Next, run 'make dep && make clean && make'"
+