summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure133
1 files changed, 57 insertions, 76 deletions
diff --git a/configure b/configure
index 54011f14..1f3ac45e 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
-# ToscoConf 0.02
-# Copyright (c) 2003 Leandro Pereira <leandro@linuxmag.com.br>
+# ToscoConf 0.04
+# Copyright (c) 2003-2004 Leandro Pereira <leandro@linuxmag.com.br>
# All rights reserved.
#
# This script is in the Tosco Public License. It may be copied and/or
@@ -21,35 +21,32 @@
# ---------------------------------------------------------------------------
# Some defaults
-IGNORE_GTK2=0
DISABLE_NLS=0
+IGNORE_LSPCI=0
# ---------------------------------------------------------------------------
PACKAGE=`basename ${PWD} | cut -d"-" -f1`;
VERSION=`basename ${PWD} | cut -d"-" -f2`;
-echo "ToscoConf (version 0.03) for $PACKAGE version $VERSION"
+echo "ToscoConf (version 0.04) for $PACKAGE version $VERSION"
# ---------------------------------------------------------------------------
# Damn-cool command line argument parsing. Yay.
while [ "$1" != "" ]; do
case $1 in
- --with-gtk1)
- echo "Building with GTK+ 1.2"
- IGNORE_GTK2=1;;
- --with-gtk2)
- echo "Building with GTK+ 2.0"
- IGNORE_GTK2=0;;
+ --disable-lspci)
+ echo "Disabling lspci"
+ IGNORE_LSPCI=1;;
--disable-nls)
echo "NLS disabled."
DISABLE_NLS=1 ;;
--help)
+ echo ""
echo " --disable-nls Don't use i18n."
- echo "Interface (default is auto-test):"
- echo " --with-gtk1 Build with GTK1.2 interface."
- echo " --with-gtk2 Build with GTK2.0 interface."
+ echo " --disable-lspci Disable lspci."
+ echo ""
echo " --help This help screen."
exit 1;;
@@ -80,9 +77,25 @@ case $PROC in
ARCH="ARCH_i386" ;;
ppc)
ARCH="ARCH_PPC" ;;
+ x86_64)
+ ARCH="ARCH_x86_64" ;;
+ mips)
+ ARCH="ARCH_MIPS" ;;
+ parisc*)
+ ARCH="ARCH_PARISC" ;;
+ ia64)
+ ARCH="ARCH_IA64" ;;
*)
- echo "Architeture \"$ARCH\" not supported."
- exit ;;
+ # uname -m on m68k doesn't return anything useful :/
+ cat /proc/cpuinfo | grep "680?0" >/dev/null
+ if [ "$?" == "0" ]; then
+ ARCH="ARCH_m68k"
+ else
+ echo "Architeture \"$ARCH\" not supported."
+ exit
+ fi
+
+ ;;
esac
echo "$PROC ($ARCH)"
@@ -111,66 +124,38 @@ else
fi
fi
+if [ "$IGNORE_LSPCI" -eq 1 ]; then
+ echo "Ignoring lspci (as requested)..."
+ LSPCI=""
+ USE_LSPCI=0
+fi
+
# ---------------------------------------------------------------------------
GTK2=-1
-if [ "$IGNORE_GTK2" == "0" ]; then
- MIN_VERSION="2.0.0"
- echo -n "Checking for GTK ${MIN_VERSION}... "
- for i in `which pkg-config`; do
- pkg-config --errors-to-stdout gtk+-2.0 \
- --atleast-version=$MIN_VERSION > /dev/null
- case $? in
- 0)
- GTK_FLAGS=`pkg-config gtk+-2.0 --cflags`
- GTK_LIBS=`pkg-config gtk+-2.0 --libs`
- echo "seems ok, will not test though."
- GTK2=1 ;;
- *)
- echo "not found." ;;
- esac
- done
-fi
+MIN_VERSION="2.2.0"
+echo -n "Checking for GTK ${MIN_VERSION}... "
+for i in `which pkg-config`; do
+ pkg-config --errors-to-stdout gtk+-2.0 \
+ --atleast-version=$MIN_VERSION > /dev/null
+ case $? in
+ 0)
+ GTK_FLAGS=`pkg-config gtk+-2.0 --cflags`
+ GTK_LIBS=`pkg-config gtk+-2.0 --libs`
+ echo "OK (pkgconfig)"
+ GTK2=1 ;;
+ *)
+ echo "not found." ;;
+ esac
+done
# If the user doesn't have GTK2, try to compile with GTK1.2 :)
-
-GTK1=-1
-if [ "$GTK2" -ne 1 ]; then
- min_major=1
- min_minor=2
- min_rev=6
- echo -n "Checking for GTK $min_major.$min_minor.$min_rev... "
- for i in `which gtk-config`; do
- VER=`gtk-config --version`
-
- # RegExp stolen from AutoConf.
- major=`echo $VER | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
- minor=`echo $VER | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
- rev=`echo $VER | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
-
- if [ $major -lt $min_major ]; then
- break;
- fi
-
- if [ $minor -lt $min_minor ]; then
- break;
- fi
-
- if [ $rev -lt $min_rev ]; then
- break;
- fi
-
- GTK_FLAGS=`gtk-config --cflags`
- GTK_LIBS=`gtk-config --libs`
- echo "seems ok, will not test though."
- GTK1=1
- done
-fi
+# GTK 1.2 is no longer supported
# --------------------------------------------------------------------------
-if [ `expr $GTK1 + $GTK2` -eq -2 ]; then
+if [ $GTK2 -eq -1 ]; then
echo -e "\nYou need the GTK libraries, including the development stuff."
echo "If you're using Debian, running the command as root:"
echo -e "\n\tapt-get install libgtk2.0-dev\n"
@@ -191,11 +176,7 @@ if [ "$LSPCI" ]; then
echo "#define LSPCI \"$LSPCI -v\"" >> config.h
fi
-if [ "$GTK2" -ne -1 ]; then
- echo "#define GTK2" >> config.h
-else
- echo "#define GTK1" >> config.h
-fi
+echo "#define GTK2" >> config.h
if [ "$DISABLE_NLS" != "1" ]; then
echo "#define ENABLE_NLS" >> config.h
@@ -203,15 +184,15 @@ fi
echo "#define $ARCH" >> config.h
+echo "#define PLATFORM \"`uname`\"" >> config.h
+echo "#define KERNEL \"`uname -r`\"" >> config.h
+echo "#define HOSTNAME \"`hostname`\"" >> config.h
+
echo -e "\n#endif /* __CONFIG_H__ */" >> config.h
echo "Writing Makefile..."
rm -f Makefile
-if [ "$GTK2" -ne -1 ]; then
- echo "TARGET = GTK2" > Makefile
-else
- echo "TARGET = GTK1" > Makefile
-fi
+echo "TARGET = GTK2" > Makefile
echo "GTK_LIBS = ${GTK_LIBS}" >> Makefile
echo "GTK_CFLAGS = ${GTK_FLAGS}" >> Makefile