changeset 2292:3c2b40d19505

New package: libiberty
author Volker Grabsch <vog@notjusthosting.com>
date Thu, 22 Mar 2012 20:21:59 +0100
parents 1ed2cf183bd1
children acadaf0ccc24
files doc/index.html src/libiberty-test.c src/libiberty.mk
diffstat 3 files changed, 60 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/index.html	Thu Mar 22 14:49:37 2012 +0100
+++ b/doc/index.html	Thu Mar 22 20:21:59 2012 +0100
@@ -1314,8 +1314,8 @@
         Many new packages are supported:
         atkmm, cairomm, cunit, faac, faad2, ffmpeg, gdk-pixbuf, glibmm,
         gtkglextmm, gtkmm, gtksourceview, gtksourceviewmm, imagemagick,
-        lame, libsigc++, libvpx, matio, openal, opencore-amr, pangomm,
-        pfstools, plotmm, sdl_sound and x264.
+        lame, libiberty, libsigc++, libvpx, matio, openal, opencore-amr,
+        pangomm, pfstools, plotmm, sdl_sound and x264.
         </p>
     </dd>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/libiberty-test.c	Thu Mar 22 20:21:59 2012 +0100
@@ -0,0 +1,24 @@
+/* This file is part of mingw-cross-env.       */
+/* See doc/index.html for further information. */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <libiberty.h>
+
+int main(int argc, char *argv[])
+{
+    char *s;
+
+    (void)argc;
+    (void)argv;
+
+    if (asprintf(&s, "Test%i", 123) >= 0) {
+        printf("asprintf output: %s\n", s);
+        free(s);
+        return 0;
+    } else {
+        printf("asprintf() failed!\n");
+        return 1;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/libiberty.mk	Thu Mar 22 20:21:59 2012 +0100
@@ -0,0 +1,34 @@
+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+# libiberty
+PKG             := libiberty
+$(PKG)_IGNORE    = $(binutils_IGNORE)
+$(PKG)_VERSION   = $(binutils_VERSION)
+$(PKG)_CHECKSUM  = $(binutils_CHECKSUM)
+$(PKG)_SUBDIR    = $(binutils_SUBDIR)/libiberty
+$(PKG)_FILE      = $(binutils_FILE)
+$(PKG)_WEBSITE   = http://gcc.gnu.org/onlinedocs/libiberty/
+$(PKG)_URL       = $(binutils_URL)
+$(PKG)_URL_2     = $(binutils_URL_2)
+$(PKG)_DEPS     := gcc
+
+define $(PKG)_UPDATE
+    echo $(binutils_VERSION)
+endef
+
+define $(PKG)_BUILD
+    cd '$(1)' && ./configure \
+        --host='$(TARGET)' \
+        --enable-static \
+        --disable-shared \
+        --prefix='$(PREFIX)/$(TARGET)' \
+        --enable-install-libiberty
+    $(MAKE) -C '$(1)' -j '$(JOBS)'
+    $(MAKE) -C '$(1)' -j 1 install target_header_dir=libiberty
+
+    '$(TARGET)-gcc' \
+        -W -Wall -Werror -ansi -pedantic \
+        '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libiberty.exe' \
+        -I$(PREFIX)/$(TARGET)/include/libiberty -liberty
+endef