summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure91
1 files changed, 24 insertions, 67 deletions
diff --git a/configure b/configure
index 1f3ac45e..77f64686 100755
--- a/configure
+++ b/configure
@@ -19,44 +19,13 @@
# (yes, I did a copy&paste from the BSD license, eat me)
#
# ---------------------------------------------------------------------------
-# Some defaults
-
-DISABLE_NLS=0
-IGNORE_LSPCI=0
-
-# ---------------------------------------------------------------------------
PACKAGE=`basename ${PWD} | cut -d"-" -f1`;
VERSION=`basename ${PWD} | cut -d"-" -f2`;
-echo "ToscoConf (version 0.04) for $PACKAGE version $VERSION"
-
-# ---------------------------------------------------------------------------
-# Damn-cool command line argument parsing. Yay.
-
-while [ "$1" != "" ]; do
- case $1 in
- --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 " --disable-lspci Disable lspci."
- echo ""
- echo " --help This help screen."
-
- exit 1;;
- *)
- echo "Please use the --help switch."
- exit 1;;
- esac
- shift
-done
+[ "$PACKAGE" == "$VERSION" ] && VERSION="SVN_$(date)"
+echo "ToscoConf (version 0.04) for $PACKAGE version $VERSION"
# ---------------------------------------------------------------------------
@@ -74,21 +43,28 @@ esac
PROC=`uname -m`
case $PROC in
i?86)
+ ln -sf linux/x86 arch/this
ARCH="ARCH_i386" ;;
ppc)
+ ln -sf linux/ppc arch/this
ARCH="ARCH_PPC" ;;
x86_64)
+ ln -sf linux/x86_64 arch/this
ARCH="ARCH_x86_64" ;;
mips)
+ ln -sf linux/mips arch/this
ARCH="ARCH_MIPS" ;;
parisc*)
+ ln -sf linux/parisc arch/this
ARCH="ARCH_PARISC" ;;
- ia64)
- ARCH="ARCH_IA64" ;;
+ sparc*)
+ ln -sf linux/sparc arch/this
+ ARCH="ARCH_SPARC" ;;
*)
# uname -m on m68k doesn't return anything useful :/
- cat /proc/cpuinfo | grep "680?0" >/dev/null
+ grep "680?0" /proc/cpuinfo > /dev/null
if [ "$?" == "0" ]; then
+ ln -sf linux/m68k arch/this
ARCH="ARCH_m68k"
else
echo "Architeture \"$ARCH\" not supported."
@@ -103,11 +79,10 @@ echo "$PROC ($ARCH)"
# ---------------------------------------------------------------------------
echo -n "Checking for lspci... "
-LSPCIPATH="`which lspci` /sbin/lspci /usr/sbin/lspci /bin/lspci /usr/bin/lspci"
+LSPCIPATH="/sbin/lspci /usr/sbin/lspci /bin/lspci /usr/bin/lspci `which lspci`"
for i in $LSPCIPATH; do
if [ -x "$i" ]; then
- USE_LSPCI=1
- LSPCI=$i
+ LSPCI=$i
break;
fi
done
@@ -115,26 +90,14 @@ done
if [ -e "$LSPCI" ]; then
echo $LSPCI
else
- if [ -e "/proc/pci" ]; then
- echo "not found, will parse /proc/pci"
- else
- echo "no lspci, no /proc/pci..."
- echo "Are you sure you're running Linux?"
- exit
- fi
-fi
-
-if [ "$IGNORE_LSPCI" -eq 1 ]; then
- echo "Ignoring lspci (as requested)..."
- LSPCI=""
- USE_LSPCI=0
+ echo "lspci cannot be found"
+ exit
fi
# ---------------------------------------------------------------------------
-
GTK2=-1
-MIN_VERSION="2.2.0"
+MIN_VERSION="2.6.0"
echo -n "Checking for GTK ${MIN_VERSION}... "
for i in `which pkg-config`; do
pkg-config --errors-to-stdout gtk+-2.0 \
@@ -150,9 +113,6 @@ for i in `which pkg-config`; do
esac
done
-# If the user doesn't have GTK2, try to compile with GTK1.2 :)
-# GTK 1.2 is no longer supported
-
# --------------------------------------------------------------------------
if [ $GTK2 -eq -1 ]; then
@@ -172,31 +132,29 @@ echo -e "#ifndef __CONFIG_H__\n#define __CONFIG_H__\n" > config.h
echo "#define VERSION \"$VERSION\"" >> config.h
if [ "$LSPCI" ]; then
- echo "#define USE_LSPCI" >> config.h
echo "#define LSPCI \"$LSPCI -v\"" >> config.h
fi
-echo "#define GTK2" >> config.h
-
-if [ "$DISABLE_NLS" != "1" ]; then
- echo "#define ENABLE_NLS" >> config.h
-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 "#define PREFIX \"/usr/share/hardinfo/\"" >> config.h
+echo "#define DEBUG 1" >> config.h
+
echo -e "\n#endif /* __CONFIG_H__ */" >> config.h
echo "Writing Makefile..."
rm -f Makefile
-echo "TARGET = GTK2" > Makefile
-echo "GTK_LIBS = ${GTK_LIBS}" >> Makefile
+echo "GTK_LIBS = ${GTK_LIBS}" > Makefile
echo "GTK_CFLAGS = ${GTK_FLAGS}" >> Makefile
+echo "GLADE_LIBS = ${GLADE_LIBS}" >> Makefile
+echo "GLADE_CFLAGS = ${GLADE_FLAGS}" >> Makefile
echo "PACKAGE = `basename ${PWD}`" >> Makefile
+echo "ARCHOPTS = " >> Makefile
cat Makefile.in >> Makefile
@@ -204,4 +162,3 @@ echo -e "\nDone. Type \"make\" to compile the program.\n"
echo "If you get errors, probably you don't have the right libraries,"
echo "includes or utilities. However, if you're sure this is a bug in my"
echo -e "code, please send a patch (use \"diff -u\") to <leandro@linuxmag.com.br>.\n"
-