diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 97 |
1 files changed, 52 insertions, 45 deletions
@@ -20,36 +20,11 @@ # # --------------------------------------------------------------------------- -## hack created to avoid dpkg-source error -## I did not put this on rules because if everything works fine -## upstream author will put this on package tarball - -create_links ( ) { -echo "Debug links"; -echo $PWD; -ln -sf ../common/alsa.h arch/linux/$1/ -ln -sf ../common/filesystem.h arch/linux/$1/ -ln -sf ../common/inputdevices.h arch/linux/$1/ -ln -sf ../common/loadavg.h arch/linux/$1/ -ln -sf ../common/memory.h arch/linux/$1/ -ln -sf ../common/modules.h arch/linux/$1/ -ln -sf ../common/net.h arch/linux/$1/ -ln -sf ../common/nfs.h arch/linux/$1/ -ln -sf ../common/os.h arch/linux/$1/ -ln -sf ../common/pci.h arch/linux/$1/ -ln -sf ../common/samba.h arch/linux/$1/ -ln -sf ../common/sensors.h arch/linux/$1/ -ln -sf ../common/storage.h arch/linux/$1/ -ln -sf ../common/uptime.h arch/linux/$1/ -ln -sf ../common/usb.h arch/linux/$1/ -echo "Done ..."; -} - 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 @@ -65,7 +40,7 @@ case $OS in Linux) ;; *) - echo " (not supported, yet!)" + echo "$OS (not supported, yet!)" exit ;; esac @@ -93,25 +68,17 @@ case $PROC in ln -sf linux/armv4l arch/this ARCH="ARCH_ARMV4L" ;; ia64) - create_links ia64; ln -sf linux/ia64 arch/this ARCH="ARCH_IA64" ;; alpha) - create_links alpha; ln -sf linux/alpha arch/this ARCH="ARCH_ALPHA" ;; s390) - create_links s390; ln -sf linux/s390 arch/this ARCH="ARCH_S390" ;; m68k) - create_links s390; - ln -sf linux/m68k arch/this + ln -sf linux/m68k arch/this ARCH="ARCH_m68k" ;; - *) - echo "Architeture \"$ARCH\" not supported." - exit - ;; esac if [ "x$ARCH" == "x" ]; then @@ -153,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 @@ -171,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 # -------------------------------------------------------------------------- @@ -186,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 @@ -193,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 @@ -203,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 @@ -226,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 |