diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index b949b0f5ee..7c14ea9fab 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=7.6
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit"
@@ -26,6 +26,28 @@ long_desc="
    * Change things in your program, so you can experiment with correcting the
      effects of one bug and go on to learn about another."
 
+# Package build options
+build_options="gdbserver static"
+desc_option_gdbserver="Enable support for building GDB server"
+desc_option_static="Enable support for building GDB statically"
+
+# Enable gdbserver if !static.
+build_options_default="gdbserver"
+
+if [ "$build_option_gdbserver" ]; then
+	configure_args+=" --enable-gdbserver=yes"
+else
+	configure_args+=" --enable-gdbserver=no"
+fi
+
+if [ "$build_option_static" ]; then
+	configure_args+=" CFLAGS=-static"
+fi
+
+if [ "$build_option_gdbserver" -a "$build_option_static" ]; then
+	msg_error "$pkgver: gdbserver and static options cannot be enabled at the same time!\n"
+fi
+
 post_install() {
 	# resolve conflicts with binutils
 	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib