Code Search for Developers
 
 
  

build.sh from Gtk-Gnutella at Krugle


Show build.sh syntax highlighted

#! /bin/sh

# This is a simple wrapper script to make compiling a bit easier.
# Configure is too verbose and curious about many things and not
# sufficiently eloquent about others such as available options.

# Bail out on unexpected errors
set -e

# This is not interactive
exec </dev/null

build_bindir=
build_configure_only=
build_datadir=
build_dbus=
build_gnutls=
build_halloc=
build_ipv6=
build_localedir=
build_nls=
build_official=
build_so_suffix=
build_socker=
build_ui=

while [ $# -gt 0 ]; do
	case "$1" in
	--bindir=*)		build_bindir="${1#--*=}";;
	--cc=*)			CC="${1#--*=}";;
	--cflags=*)		CFLAGS="${1#--*=}";;
	--configure-only)	build_configure_only='yes';;
	--datadir=*)		build_datadir="${1#--*=}";;
	--disable-dbus)		build_dbus='d_dbus';;
	--disable-gnutls)	build_gnutls='d_gnutls';;
	--disable-ipv6)		build_ipv6='d_ipv6';;
	--disable-nls)		build_nls='d_enablenls';;
	--disable-socker)	build_socker='d_socker_get';;
	--enable-halloc)	build_halloc='true';;
	--gtk1)			build_ui='gtkversion=1';;
	--gtk2)			build_ui='gtkversion=2';;
	--ldflags=*)		LDFLAGS="${1#--*=}";;
	--localedir=*)		build_localedir="${1#--*=}";;
	--mandir=*)		build_mandir="${1#--*=}";;
	--make=*)		MAKE="${1#--*=}";;
	--prefix=*)		PREFIX="${1#--*=}";;
	--topless)		build_ui='d_headless';;
	--unofficial)		build_official='false';;
	--yacc=*)		YACC="${1#--*=}";;
	--) 		break
			;;
	*)
echo 'The following switches are available, defaults are shown in brackets:'
echo
echo '  --gtk2           Use Gtk+ 2.x for the user interface [default].'
echo '  --gtk1           Use the deprecated Gtk+ 1.2 for the user interface.'
echo '  --topless        Compile for topless use (no graphical user interface).'
echo '  --disable-dbus   Do not use D-Bus even if available.'
echo '  --disable-gnutls Do not use GNU TLS even if available.'
echo '  --disable-ipv6   Do not use IPv6 even if supported.'
echo '  --disable-nls    Disable NLS (native language support).'
echo '  --disable-socker Disable support for Socker.'
echo '  --prefix=PATH    Path prefix used for installing files. [$PREFIX]'
echo '  --bindir=PATH    Directory for installing executables. [$PREFIX/bin]'
echo '  --datadir=PATH   Directory for installing application data. [$PREFIX/share]'
echo '  --localedir=PATH Directory for installing locale data. [$PREFIX/share/locale]'
echo '  --mandir=PATH    Directory for installing manual pages. [$PREFIX/man]'
echo '  --cc=TOOL        C compiler to use. [$CC]'
echo '  --cflags=FLAGS   Flags to pass to the C compiler. [$CFLAGS]'
echo '  --ldflags=FLAGS  Flags to pass to the linker. [$LDFLAGS]'
echo '  --make=TOOL      make tool to be used. [$MAKE]'
echo '  --yacc=TOOL      yacc, bison or some compatible tool. [$YACC]'
echo '  --configure-only Do not run make after Configure.'
echo '  --unofficial     Use for test builds only. Requires no installation.'
echo '  --enable-halloc  Enable mmap()-based malloc() replacement.'
echo
echo 'Typically no switches need to be used. Just run '"$0"' to start the'
echo 'build process.'
			case "$1" in
			--help);;
			*) 	echo
				echo "ERROR: Unknown switch: \"$1\"";;
		esac
		exit 1
		;;
	esac
	shift
done

if [ "X$MAKE" = X ]; then
	command -v gmake >/dev/null 2>&1 && MAKE=gmake || MAKE=make
fi

if [ "X$YACC" = X ]; then
	command -v yacc >/dev/null 2>&1 && YACC=yacc || YACC=bison
fi

CFLAGS="$CFLAGS${build_halloc:+ -DUSE_HALLOC}"
PREFIX=${PREFIX:-/usr/local}

build_bindir=${build_bindir:-$PREFIX/bin}
build_bindir=${build_bindir:+"$build_bindir"}

build_mandir=${build_mandir:-$PREFIX/man}
build_mandir=${build_mandir:+"$build_mandir"}

build_datadir=${build_datadir:-$PREFIX/share/gtk-gnutella}
build_datadir=${build_datadir:+"$build_datadir"}

build_localedir=${build_localedir:-$PREFIX/share/locale}
build_localedir=${build_localedir:+"$build_localedir"}

build_official=${build_official:-true}
build_ui=${build_ui:-gtkversion=2}

# There is something broken about Configure, so it needs to know the
# suffix for shared objects (dynamically loaded libraries) for some odd
# reasons.
case "`uname -s`" in
darwin|Darwin) build_so_suffix='dylib';;
esac

# Make sure previous Configure settings have no influence.
${MAKE} clobber >/dev/null 2>&1 || : ignore failure
rm -f config.sh

# Use /bin/sh explicitely so that it works on noexec mounted file systems.
# Note: Configure won't work as of yet on such a file system.
/bin/sh ./Configure -Oders \
	-U usenm \
	${CC:+-D "cc=$CC"} \
	${CFLAGS:+-D "ccflags=$CFLAGS"} \
	${LDFLAGS:+-D "ldflags=$LDFLAGS"} \
	${PREFIX:+-D "prefix=$PREFIX"} \
	${MAKE:+-D "make=$MAKE"} \
	${YACC:+-D "yacc=$YACC"} \
	${build_bindir:+-D "bindir=$build_bindir"} \
	${build_datadir:+-D "privlib=$build_datadir"} \
	${build_localedir:+-D "locale=$build_localedir"} \
	${build_mandir:+-D "sysman=$build_mandir"} \
	${build_official:+-D "official=$build_official"} \
	${build_so_suffix:+-D "so=$build_so_suffix"} \
	${build_ui:+-D "$build_ui"} \
	${build_nls:+-U "$build_nls"} \
	${build_dbus:+-U "$build_dbus"} \
	${build_gnutls:+-U "$build_gnutls"} \
	${build_ipv6:+-U "$build_ipv6"} \
	${build_socker:+-U "$build_socker"} \
	|| { echo; echo 'ERROR: Configure failed.'; exit 1; }

if [ "X$build_configure_only" != X ]; then
	exit
fi

${MAKE} || { echo; echo 'ERROR: Compiling failed.'; exit 1; }

echo "Run \"${MAKE} install\" to install gtk-gnutella."
exit





See more files for this project here

Gtk-Gnutella

A GTK+ Gnutella client for Unix, efficient, reliable and fast, written in C. It has been optimized for speed and scalability, with low-memory consumption. It is meant to be left running 24x7, using little CPU and only the configured bandwidth.

Project homepage: http://sourceforge.net/projects/gtk-gnutella
Programming language(s): C
License: other

  U/
    modified/
      End.U
      Loc.U
      Myinit.U
      prototype.U
    new/
      Alpha_mieee.U
      GCC_pipe.U
      Largefile.U
      Sendfile64.U
      d_bindtxtcode.U
      d_built_popcount.U
      d_closefrom.U
      d_deflate.U
      d_devpoll.U
      d_dirent_d_type.U
      d_epoll.U
      d_fast_assert.U
      d_getaddrinfo.U
      d_geteuid.U
      d_getifaddrs.U
      d_getinvent.U
      d_gettext.U
      d_getuid.U
      d_gnugettext.U
      d_herror.U
      d_hstrerror.U
      d_iconv.U
      d_inflate.U
      d_initstate.U
      d_iptos.U
      d_ipv6.U
      d_kevent_udata.U
      d_kqueue.U
      d_locale_charset.U
      d_madvise.U
      d_msg_flags.U
      d_nls.U
      d_posix_fadvise.U
      d_posix_memalign.U
      d_random.U
      d_regparm.U
      d_sa_interrupt.U
      d_sendfile.U
      d_setproctitle.U
      d_sockaddr_in_sin_len.U
      d_socker_get.U
      d_srandom.U
      d_strcasestr.U
      d_strlcat.U
      d_strlcpy.U
      d_sysctl.U
      d_vsnprintf.U
      enablenls.U
      i_iconv.U
      i_ifaddrs.U
      i_invent.U
      i_langinfo.U
      i_libcharset.U
      i_libintl.U
      i_netdb.U
      i_netif.U
      i_niip.U
      i_syssendfile.U
      i_syssysctl.U
      i_sysutsname.U
      i_zlib.U
      locale.U
      msgmerge_update.U
      official.U
    packages/
      dbusconfig.U
      glade.U
      glibconfig.U
      glibversion.U
      gnutlsconfig.U
      gtkconfig.U
      gtkversion.U
      remotectrl.U
      xmlconfig.U
    specific/
      d_headless.U
      gtkgversion.U
  cygwin/
    dirs
    rules
  debian/
    changelog
    compat
    control
    copyright
    dirs
    menu
    rules
    watch
  doc/
    api/
    devguide/
    gnutella/
    http/
    manual/
    other/
    public/
  extra_files/
    el/
    en/
    ja/
    Jmakefile
    Makefile.SH
    bogons.txt
    favicon.png
    geo-ip.txt
    gtk-gnutella.16.png
    gtk-gnutella.32.png
    gtk-gnutella.desktop
    gtk-gnutella.png
    gtk-gnutella.svg
    hostiles.txt
    magnet.svg
    robots.txt
    spam.txt
    spam_sha1.txt
  pixmaps/
    Jmakefile
    Makefile.SH
    arrow_down.xpm
    arrow_up.xpm
    booklib.xpm
    booksha.xpm
    bookshav.xpm
    booktth.xpm
    chip.xpm
    clanbomber_red.xpm
    clanbomber_yellow.xpm
    download.xpm
    exit.xpm
    filter.xpm
    firewall.xpm
    firewall_punchable.xpm
    firewall_tcp.xpm
    firewall_udp.xpm
    firewall_udp_punchable.xpm
    freeze.xpm
    icon.16x16.xpm
    icon.32x32.xpm
    icon.xpm
    leaf.xpm
    legacy.xpm
    magnet.16x16.png
    magnet.32x32.png
    magnet.64x64.png
    no_firewall.xpm
    offline.xpm
    online.xpm
    save.xpm
    smallserver.xpm
    stock_form-time-field-16.xpm
    thaw.xpm
    ultra.xpm
    upload.xpm
    warning.xpm
  po/
    LINGUAS
    Makefile.SH
    Makefile.in.in
    Makevars
    POTFILES.in
    boldquot.sed
    de.po
    el.po
    es.po
    fr.po
    gtk-gnutella.pot
    hu.po
    insert-header.sin
    it.po
    ja.po
    nb.po
    nl.po
    quot.sed
    remove-potcdate.sin
    tr.po
    uk.po
    zh_CN.po
  scripts/
    fix_copyright.pl
    geo-to-db.pl
    gtkg-dbus-listener.py
    magnet-handler.sh
    magnetize.sh
    sha1_cache.pl
    sha1_cache.sh
    svn-revision
  src/
    core/
    dht/
    if/
    lib/
    shell/
    ui/
    Jmakefile
    Makefile.SH
    casts.h
    common.h
    gtk-gnutella.man
    main.c
    revision.h
    revision_h.SH
  AUTHORS
  ChangeLog
  Configure
  GEO_LICENSE
  Jmakefile
  LICENSE
  MANIFEST
  Makefile.SH
  README
  README.Debian
  README.xmingw
  TODO
  build.sh
  config.sh.xmingw
  config_h.SH
  gtk-gnutella_spec.SH
  install.SH