aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure88
1 files changed, 64 insertions, 24 deletions
diff --git a/configure b/configure
index f254de5a..80906b62 100755
--- a/configure
+++ b/configure
@@ -24,7 +24,7 @@ PACKAGE=`basename ${PWD} | cut -d"-" -f1`;
VERSION=`basename ${PWD} | cut -d"-" -f2`;
if [ "$PACKAGE" == "$VERSION" ]; then
- VERSION=$(printf "SVN_%d" $(svn -R info|grep Revision|cut -d: -f2|sort -n|tail -n1))
+ VERSION=$(printf "SVN_%d" $(LC_ALL=C svn -R info|grep Revision|cut -d: -f2|sort -n|tail -n1))
RELEASE=0
else
RELEASE=1
@@ -40,7 +40,7 @@ case $OS in
Linux)
;;
*)
- echo " (not supported, yet!)"
+ echo "$OS (not supported, yet!)"
exit ;;
esac
@@ -64,21 +64,21 @@ case $PROC in
sparc*)
ln -sf linux/sparc arch/this
ARCH="ARCH_SPARC" ;;
- armv4l)
+ armv*)
ln -sf linux/armv4l arch/this
ARCH="ARCH_ARMV4L" ;;
- *)
- # uname -m on m68k doesn't return anything useful :/
- 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."
- exit
- fi
-
- ;;
+ ia64)
+ ln -sf linux/ia64 arch/this
+ ARCH="ARCH_IA64" ;;
+ alpha)
+ ln -sf linux/alpha arch/this
+ ARCH="ARCH_ALPHA" ;;
+ s390)
+ ln -sf linux/s390 arch/this
+ ARCH="ARCH_S390" ;;
+ m68k)
+ ln -sf linux/m68k arch/this
+ ARCH="ARCH_m68k" ;;
esac
if [ "x$ARCH" == "x" ]; then
@@ -120,14 +120,15 @@ GTK2=-1
MIN_VERSION="2.6.0"
echo -n "Checking for GTK version >= ${MIN_VERSION}... "
for i in `which pkg-config`; do
- pkg-config --errors-to-stdout gtk+-2.0 \
+ $i --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 "found `pkg-config gtk+-2.0 --modversion`"
- GTK2=1 ;;
+ GTK2=1
+ break ;;
*)
echo "not found." ;;
esac
@@ -138,9 +139,39 @@ done
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"
+ echo -e "\n\taptitude install libgtk2.0-dev\n"
echo "Will do the trick."
- exit
+ exit 1
+fi
+
+# ---------------------------------------------------------------------------
+
+SOUP=-1
+MIN_VERSION="2.2.7"
+echo -n "Checking for libsoup version >= ${MIN_VERSION}... "
+for i in `which pkg-config`; do
+ $i --errors-to-stdout libsoup-2.2 \
+ --atleast-version=$MIN_VERSION > /dev/null
+ case $? in
+ 0)
+ SOUP_FLAGS=`pkg-config libsoup-2.2 --cflags`
+ SOUP_LIBS=`pkg-config libsoup-2.2 --libs`
+ echo "found `pkg-config libsoup-2.2 --modversion`"
+ SOUP=1
+ break ;;
+ *)
+ echo "not found." ;;
+ esac
+done
+
+# --------------------------------------------------------------------------
+
+if [ $SOUP -eq -1 ]; then
+ echo -e "\nYou need the libsoup library, including the development stuff."
+ echo "If you're using Debian, running the command as root:"
+ echo -e "\n\taptitude install libsoup2.2-dev\n"
+ echo "Will do the trick."
+ exit 1
fi
# --------------------------------------------------------------------------
@@ -153,6 +184,7 @@ echo "#define VERSION \"$VERSION\"" >> config.h
echo "#define LSPCI \"$LSPCI -v\"" >> config.h
echo "#define $ARCH" >> config.h
+echo "#define ARCH \"$ARCH\"" >> config.h
echo "#define PLATFORM \"`uname`\"" >> config.h
echo "#define KERNEL \"`uname -r`\"" >> config.h
@@ -160,8 +192,16 @@ echo "#define HOSTNAME \"`hostname`\"" >> config.h
echo "#define PREFIX \"/usr/share/hardinfo/\"" >> config.h
echo "#define LIBPREFIX \"/usr/lib/hardinfo/\"" >> config.h
-echo "#define DEBUG 1" >> config.h
-echo "#define ENABLE_BINRELOC" >> config.h
+
+if [ "$RELEASE" == "1" ]; then
+ echo "#define DEBUG(...)" >> config.h
+else
+ echo '#define DEBUG(msg,...) fprintf(stderr, "*** %s:%d (%s) *** " msg "\n", \' >> config.h
+ echo ' __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)' >> config.h
+fi
+
+echo "#define ENABLE_BINRELOC 1" >> config.h
+echo "#define RELEASE $RELEASE" >> config.h
echo -e "\n#endif /* __CONFIG_H__ */" >> config.h
@@ -170,8 +210,8 @@ rm -f 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 "SOUP_LIBS = ${SOUP_LIBS}" >> Makefile
+echo "SOUP_CFLAGS = ${SOUP_FLAGS}" >> Makefile
echo "PACKAGE = `basename ${PWD}`" >> Makefile
echo "ARCHOPTS = " >> Makefile
@@ -193,6 +233,6 @@ else
cat << EOF
If you get errors, probably you don't have the right libraries,
includes or utilities. However, if you're sure this is a bug in my
-code, please send a patch (use \"diff -u\") to <leandro@linuxmag.com.br>.
+code, please send a patch (use "diff -u") to <leandro@linuxmag.com.br>.
EOF
fi