diff options
| author | Leandro Pereira <leandro@linuxmag.com.br> | 2004-06-14 21:33:25 -0300 | 
|---|---|---|
| committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:31 -0500 | 
| commit | 7d65a12d6431f72e601ea1d0c3ef5d09af8bfb96 (patch) | |
| tree | 7ad1761adce3212a13e5342a54865e31b917f18b /configure | |
| parent | 0864b0a8e6f0b0983c3536931cfbad1414137d6b (diff) | |
| parent | 8c1612d32c5682a86216adb8c8d11ce715fe5475 (diff) | |
Import Debian changes 0.3.6-5
hardinfo (0.3.6-5) unstable; urgency=high
  * Add Amd64 support (closes: #253935).
    Thanks to Kurt Roeckx <Q@ping.be>
  * Close duplicate "doesn't work with newer pciutils" bug (closes: #254018).
hardinfo (0.3.6-4) unstable; urgency=high
  * Fixed segfault on startup (closes: #242843).
    Thanks to Remco van de Meent <remco@debian.org>
hardinfo (0.3.6-3) unstable; urgency=high
  * Added Debian menu entry icon.
  * Fixed some misc packaging bugs.
  * Changed package description.
hardinfo (0.3.6-2) unstable; urgency=low
  * Sync with upstream sources.
  * Disabled "Network" tab.
hardinfo (0.3.6-1) unstable; urgency=high
  * Sync with upstream sources.
hardinfo (0.3.5-1) unstable; urgency=high
  * Sync with upstream sources.
hardinfo (0.3.4-1) unstable; urgency=high
  * Sync with upstream sources.
hardinfo (0.3.3-1) unstable; urgency=low
  * Sync with upstream sources.
hardinfo (0.3.2-1) unstable; urgency=low
  * Sync with upstream sources.
hardinfo (0.3.1-1) unstable; urgency=low
  * Sync with upstream sources.
hardinfo (0.3-1) unstable; urgency=low
  * Initial Release.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 228 | 
1 files changed, 228 insertions, 0 deletions
| diff --git a/configure b/configure new file mode 100755 index 00000000..7ea4e433 --- /dev/null +++ b/configure @@ -0,0 +1,228 @@ +#!/usr/bin/env bash +# +# ToscoConf 0.02 +# Copyright (c) 2003 Leandro Pereira <leandro@linuxmag.com.br> +# All rights reserved. +# +# This script is in the Tosco Public License. It may be copied and/or +# modified, in whole or in part, provided that all copies must retain the +# above copyright notice, this condition and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# +# (yes, I did a copy&paste from the BSD license, eat me) +# +# --------------------------------------------------------------------------- +# Some defaults + +IGNORE_GTK2=0 +DISABLE_NLS=0 + +# --------------------------------------------------------------------------- + +PACKAGE=`basename ${PWD} | cut -d"-" -f1`; +VERSION=`basename ${PWD} | cut -d"-" -f2`; + +echo "ToscoConf (version 0.03) 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-nls) +			echo "NLS disabled." +			DISABLE_NLS=1 ;; +		--help) +			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 " --help			This help screen." + +			exit 1;; +		*) +			echo "Please use the --help switch." +			exit 1;; +	esac +	shift +done + + +# --------------------------------------------------------------------------- + +echo -n "Running: " +OS=`uname` +echo -n $OS +case $OS in		 +	Linux) +		echo -n " (OK) " ;; +	*) +		echo " (not supported, yet!)" +		exit ;; +esac	 + +PROC=`uname -m` +case $PROC in +	i?86) +		ARCH="ARCH_i386" ;; +	ppc) +		ARCH="ARCH_PPC" ;; +	x86_64) +		ARCH="ARCH_x86_64" ;; +	*) +		echo "Architeture \"$ARCH\" not supported."  +		exit ;; +esac + +echo "$PROC ($ARCH)" + +# --------------------------------------------------------------------------- + +echo -n "Checking for lspci... " +LSPCIPATH="`which lspci` /sbin/lspci /usr/sbin/lspci /bin/lspci /usr/bin/lspci" +for i in $LSPCIPATH; do +	if [ -x "$i" ]; then +		USE_LSPCI=1 +		LSPCI=$i +		break; +	fi +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 + +# --------------------------------------------------------------------------- + + +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 + +# 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 + +# -------------------------------------------------------------------------- + +if [ `expr $GTK1 + $GTK2` -eq -2 ]; 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 "Will do the trick." +	exit +fi + +# -------------------------------------------------------------------------- + +echo -e "\nWriting config.h..." +rm -f config.h +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 + +if [ "$GTK2" -ne -1 ]; then +	echo "#define GTK2" >> config.h +else +	echo "#define GTK1" >> config.h +fi + +if [ "$DISABLE_NLS" != "1" ]; then +	echo "#define ENABLE_NLS" >> config.h +fi + +echo "#define $ARCH" >> 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 "GTK_LIBS = ${GTK_LIBS}" >> Makefile +echo "GTK_CFLAGS = ${GTK_FLAGS}" >> Makefile +echo "PACKAGE = `basename ${PWD}`" >> Makefile + +cat Makefile.in >> Makefile + +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" + | 
