]> mj.ucw.cz Git - libucw.git/commitdiff
Exampled moved to a top-level directory
authorMartin Mares <mj@ucw.cz>
Sat, 18 Feb 2012 17:09:18 +0000 (18:09 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 18 Feb 2012 17:09:18 +0000 (18:09 +0100)
20 files changed:
examples/external-ucw-build/Makefile [new file with mode: 0644]
examples/external-ucw-build/configure [new file with mode: 0755]
examples/external-ucw-build/default.cfg [new file with mode: 0644]
examples/external-ucw-build/test.c [new file with mode: 0644]
examples/external/Makefile [new file with mode: 0644]
examples/external/test.c [new file with mode: 0644]
examples/internal/Makefile [new file with mode: 0644]
examples/internal/configure [new file with mode: 0755]
examples/internal/default.cfg [new file with mode: 0644]
examples/internal/test.c [new file with mode: 0644]
free/libs/examples/external-ucw-build/Makefile [deleted file]
free/libs/examples/external-ucw-build/configure [deleted file]
free/libs/examples/external-ucw-build/default.cfg [deleted file]
free/libs/examples/external-ucw-build/test.c [deleted file]
free/libs/examples/external/Makefile [deleted file]
free/libs/examples/external/test.c [deleted file]
free/libs/examples/internal/Makefile [deleted file]
free/libs/examples/internal/configure [deleted file]
free/libs/examples/internal/default.cfg [deleted file]
free/libs/examples/internal/test.c [deleted file]

diff --git a/examples/external-ucw-build/Makefile b/examples/external-ucw-build/Makefile
new file mode 100644 (file)
index 0000000..5715c25
--- /dev/null
@@ -0,0 +1,34 @@
+# Example Makefile for a stand-alone program using the libucw build system
+# (c) 2007 Martin Mares <mj@ucw.cz>
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+
+# The default target
+all: runtree programs
+
+# Include configuration
+s=.
+-include obj/config.mk
+obj/config.mk:
+       @echo "You need to run configure first." && false
+
+# Do not show strange errors if the BUILDSYS is not set
+# (it happens if noone called configure as reported above)
+ifdef BUILDSYS
+
+# We will use the libucw build system
+include $(BUILDSYS)/Maketop
+
+# Add the detected flags to all the global flags
+CFLAGS+=$(LIBUCW_CFLAGS)
+LIBS+=$(LIBUCW_LIBS)
+
+# Programs we want to compile
+PROGS+=$(o)/test
+
+# And how they are created
+$(o)/test: $(o)/test.o $(LIBUCW)
+
+# And finally the default rules of the build system
+include $(BUILDSYS)/Makebottom
+
+endif
diff --git a/examples/external-ucw-build/configure b/examples/external-ucw-build/configure
new file mode 100755 (executable)
index 0000000..ec4b279
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+# Configure script for the libucw example (inspired by ../external/configure)
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+
+use warnings;
+use strict;
+
+our($srcdir, $libdir);
+BEGIN {
+       # Find the sources
+       my $pkgfile = "test.c";
+       if (!defined ($srcdir = $ENV{"SRCDIR"})) {
+               if (-f $pkgfile) {
+                       $srcdir=".";
+               } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
+                       $srcdir=$1;
+               } else {
+                       die "Don't know how to find myself. Please set SRCDIR manually.\n";
+               }
+       }
+       # Ask pkg-config if libucw is installed and find its configure modules
+       `pkg-config libucw --atleast-version=3.13`;
+       !$? or die "Package `libucw' (version 3.13 or newer) not found. Is PKG_CONFIG_PATH set properly?\n";
+       $libdir=`pkg-config libucw --variable=perl_modules_dir`;
+       chomp $libdir;
+       die "Unable to find the libucw configure system\n" if $? || not defined $libdir;
+}
+use lib $libdir;
+use UCW::Configure;
+
+Init($srcdir, 'default.cfg');
+Log "### Configuring TestApp ###\n\n";
+Include Get("CONFIG");
+# What should be detected?
+require UCW::Configure::Build;
+require UCW::Configure::Paths;
+require UCW::Configure::C;
+require UCW::Configure::Pkg;
+# You could generate your own documentation, too
+# require UCW::Configure::Doc;
+
+# Get some libraries
+UCW::Configure::Pkg::PkgConfig("libucw") or Fail("libUCW is required");
+Finish();
+
+Log "\nConfigured, run `make' to build everything.\n";
diff --git a/examples/external-ucw-build/default.cfg b/examples/external-ucw-build/default.cfg
new file mode 100644 (file)
index 0000000..48f5ec2
--- /dev/null
@@ -0,0 +1,5 @@
+
+# You can specify default configuration here:
+# Set("SOME_SYMBOL");
+
+1;
diff --git a/examples/external-ucw-build/test.c b/examples/external-ucw-build/test.c
new file mode 100644 (file)
index 0000000..19a2685
--- /dev/null
@@ -0,0 +1,8 @@
+#include <ucw/lib.h>
+
+int main(void)
+{
+       log_init("test");
+       msg(L_INFO, "Hoooot!");
+       return 0;
+}
diff --git a/examples/external/Makefile b/examples/external/Makefile
new file mode 100644 (file)
index 0000000..0cb26a1
--- /dev/null
@@ -0,0 +1,8 @@
+# Example Makefile for a stand-alone program using libucw
+
+CFLAGS:=$(shell pkg-config --cflags libucw)
+LDLIBS:=$(shell pkg-config --libs libucw)
+
+all: test
+
+test: test.c
diff --git a/examples/external/test.c b/examples/external/test.c
new file mode 100644 (file)
index 0000000..28e45c8
--- /dev/null
@@ -0,0 +1,8 @@
+#include <ucw/lib.h>
+
+int main(void)
+{
+  log_init("test");
+  msg(L_INFO, "Hoooot!");
+  return 0;
+}
diff --git a/examples/internal/Makefile b/examples/internal/Makefile
new file mode 100644 (file)
index 0000000..633ca09
--- /dev/null
@@ -0,0 +1,37 @@
+# Example Makefile for a stand-alone program using the libucw build system
+# (c) 2007 Martin Mares <mj@ucw.cz>
+
+# The default target
+all: runtree programs
+
+# Include configuration
+s=.
+-include obj/config.mk
+obj/config.mk:
+       @echo "You need to run configure first." && false
+
+BUILDSYS=$(s)/build
+
+# We will use the libucw build system
+include $(BUILDSYS)/Maketop
+
+# Set up names of common libraries (to avoid forward references in rules)
+LIBLANG=$(o)/lang/liblang.pc
+LIBCHARSET=$(o)/charset/libcharset.pc
+LIBIMAGES=$(o)/images/libimages.pc
+
+# Include makefiles of libraries we wish to use
+include $(s)/ucw/Makefile
+include $(s)/charset/Makefile
+include $(s)/lang/Makefile
+include $(s)/images/Makefile
+
+# Programs we want to compile
+PROGS+=$(o)/test
+$(o)/test: $(o)/test.o $(LIBUCW) $(LIBLANG) $(LIBCHARSET) $(LIBIMAGES)
+
+# All tests (%-t) get automatically linked with libucw
+TESTING_DEPS=$(LIBUCW)
+
+# And finally the default rules of the build system
+include $(BUILDSYS)/Makebottom
diff --git a/examples/internal/configure b/examples/internal/configure
new file mode 100755 (executable)
index 0000000..d914789
--- /dev/null
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+# Configure script for the libucw example
+# (c) 2007 Martin Mares <mj@ucw.cz>
+
+use warnings;
+use strict;
+
+our $srcdir;
+BEGIN {
+       my $pkgfile = "ucw/wildmatch.c";
+       if (!defined ($srcdir = $ENV{"SRCDIR"})) {
+               if (-f $pkgfile) {
+                       $srcdir=".";
+               } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
+                       $srcdir=$1;
+               } else {
+                       die "Don't know how to find myself. Please set SRCDIR manually.\n";
+               }
+       }
+}
+
+use lib "$srcdir/ucw/perl/";
+use UCW::Configure;
+
+Init($srcdir, "default.cfg");
+Include "ucw/default.cfg";
+Log "### Configuring TestApp ###\n\n";
+Include Get("CONFIG");
+require UCW::Configure::Paths;
+require UCW::Configure::C;
+require UCW::Configure::LibUCW;
+Finish();
+
+Log "\nConfigured, run `make' to build everything.\n";
diff --git a/examples/internal/default.cfg b/examples/internal/default.cfg
new file mode 100644 (file)
index 0000000..a133ba2
--- /dev/null
@@ -0,0 +1,24 @@
+# Default configuration file for our test application
+
+# Do a local build
+Set("CONFIG_LOCAL");
+
+# We want to build all libraries shared
+Set("CONFIG_SHARED");
+
+# Liblang settings
+Set("CONFIG_LIBLANG");
+Set("CONFIG_LANG");
+Set("MAX_WORD_CHARS" => 64);
+Set("MAX_WORD_BYTES" => 192);
+
+# Libimages settings
+Set("CONFIG_IMAGES");
+Set("CONFIG_IMAGES_LIBJPEG");
+Set("CONFIG_IMAGES_LIBPNG");
+Set("CONFIG_IMAGES_LIBUNGIF");
+UnSet("CONFIG_IMAGES_LIBGIF");
+UnSet("CONFIG_IMAGES_LIBMAGICK");
+
+# Return success
+1;
diff --git a/examples/internal/test.c b/examples/internal/test.c
new file mode 100644 (file)
index 0000000..28e45c8
--- /dev/null
@@ -0,0 +1,8 @@
+#include <ucw/lib.h>
+
+int main(void)
+{
+  log_init("test");
+  msg(L_INFO, "Hoooot!");
+  return 0;
+}
diff --git a/free/libs/examples/external-ucw-build/Makefile b/free/libs/examples/external-ucw-build/Makefile
deleted file mode 100644 (file)
index 5715c25..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Example Makefile for a stand-alone program using the libucw build system
-# (c) 2007 Martin Mares <mj@ucw.cz>
-# (c) 2008 Michal Vaner <vorner@ucw.cz>
-
-# The default target
-all: runtree programs
-
-# Include configuration
-s=.
--include obj/config.mk
-obj/config.mk:
-       @echo "You need to run configure first." && false
-
-# Do not show strange errors if the BUILDSYS is not set
-# (it happens if noone called configure as reported above)
-ifdef BUILDSYS
-
-# We will use the libucw build system
-include $(BUILDSYS)/Maketop
-
-# Add the detected flags to all the global flags
-CFLAGS+=$(LIBUCW_CFLAGS)
-LIBS+=$(LIBUCW_LIBS)
-
-# Programs we want to compile
-PROGS+=$(o)/test
-
-# And how they are created
-$(o)/test: $(o)/test.o $(LIBUCW)
-
-# And finally the default rules of the build system
-include $(BUILDSYS)/Makebottom
-
-endif
diff --git a/free/libs/examples/external-ucw-build/configure b/free/libs/examples/external-ucw-build/configure
deleted file mode 100755 (executable)
index ec4b279..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/perl
-# Configure script for the libucw example (inspired by ../external/configure)
-# (c) 2008 Michal Vaner <vorner@ucw.cz>
-
-use warnings;
-use strict;
-
-our($srcdir, $libdir);
-BEGIN {
-       # Find the sources
-       my $pkgfile = "test.c";
-       if (!defined ($srcdir = $ENV{"SRCDIR"})) {
-               if (-f $pkgfile) {
-                       $srcdir=".";
-               } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
-                       $srcdir=$1;
-               } else {
-                       die "Don't know how to find myself. Please set SRCDIR manually.\n";
-               }
-       }
-       # Ask pkg-config if libucw is installed and find its configure modules
-       `pkg-config libucw --atleast-version=3.13`;
-       !$? or die "Package `libucw' (version 3.13 or newer) not found. Is PKG_CONFIG_PATH set properly?\n";
-       $libdir=`pkg-config libucw --variable=perl_modules_dir`;
-       chomp $libdir;
-       die "Unable to find the libucw configure system\n" if $? || not defined $libdir;
-}
-use lib $libdir;
-use UCW::Configure;
-
-Init($srcdir, 'default.cfg');
-Log "### Configuring TestApp ###\n\n";
-Include Get("CONFIG");
-# What should be detected?
-require UCW::Configure::Build;
-require UCW::Configure::Paths;
-require UCW::Configure::C;
-require UCW::Configure::Pkg;
-# You could generate your own documentation, too
-# require UCW::Configure::Doc;
-
-# Get some libraries
-UCW::Configure::Pkg::PkgConfig("libucw") or Fail("libUCW is required");
-Finish();
-
-Log "\nConfigured, run `make' to build everything.\n";
diff --git a/free/libs/examples/external-ucw-build/default.cfg b/free/libs/examples/external-ucw-build/default.cfg
deleted file mode 100644 (file)
index 48f5ec2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-# You can specify default configuration here:
-# Set("SOME_SYMBOL");
-
-1;
diff --git a/free/libs/examples/external-ucw-build/test.c b/free/libs/examples/external-ucw-build/test.c
deleted file mode 100644 (file)
index 19a2685..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ucw/lib.h>
-
-int main(void)
-{
-       log_init("test");
-       msg(L_INFO, "Hoooot!");
-       return 0;
-}
diff --git a/free/libs/examples/external/Makefile b/free/libs/examples/external/Makefile
deleted file mode 100644 (file)
index 0cb26a1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Example Makefile for a stand-alone program using libucw
-
-CFLAGS:=$(shell pkg-config --cflags libucw)
-LDLIBS:=$(shell pkg-config --libs libucw)
-
-all: test
-
-test: test.c
diff --git a/free/libs/examples/external/test.c b/free/libs/examples/external/test.c
deleted file mode 100644 (file)
index 28e45c8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ucw/lib.h>
-
-int main(void)
-{
-  log_init("test");
-  msg(L_INFO, "Hoooot!");
-  return 0;
-}
diff --git a/free/libs/examples/internal/Makefile b/free/libs/examples/internal/Makefile
deleted file mode 100644 (file)
index 633ca09..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# Example Makefile for a stand-alone program using the libucw build system
-# (c) 2007 Martin Mares <mj@ucw.cz>
-
-# The default target
-all: runtree programs
-
-# Include configuration
-s=.
--include obj/config.mk
-obj/config.mk:
-       @echo "You need to run configure first." && false
-
-BUILDSYS=$(s)/build
-
-# We will use the libucw build system
-include $(BUILDSYS)/Maketop
-
-# Set up names of common libraries (to avoid forward references in rules)
-LIBLANG=$(o)/lang/liblang.pc
-LIBCHARSET=$(o)/charset/libcharset.pc
-LIBIMAGES=$(o)/images/libimages.pc
-
-# Include makefiles of libraries we wish to use
-include $(s)/ucw/Makefile
-include $(s)/charset/Makefile
-include $(s)/lang/Makefile
-include $(s)/images/Makefile
-
-# Programs we want to compile
-PROGS+=$(o)/test
-$(o)/test: $(o)/test.o $(LIBUCW) $(LIBLANG) $(LIBCHARSET) $(LIBIMAGES)
-
-# All tests (%-t) get automatically linked with libucw
-TESTING_DEPS=$(LIBUCW)
-
-# And finally the default rules of the build system
-include $(BUILDSYS)/Makebottom
diff --git a/free/libs/examples/internal/configure b/free/libs/examples/internal/configure
deleted file mode 100755 (executable)
index d914789..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/perl
-# Configure script for the libucw example
-# (c) 2007 Martin Mares <mj@ucw.cz>
-
-use warnings;
-use strict;
-
-our $srcdir;
-BEGIN {
-       my $pkgfile = "ucw/wildmatch.c";
-       if (!defined ($srcdir = $ENV{"SRCDIR"})) {
-               if (-f $pkgfile) {
-                       $srcdir=".";
-               } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
-                       $srcdir=$1;
-               } else {
-                       die "Don't know how to find myself. Please set SRCDIR manually.\n";
-               }
-       }
-}
-
-use lib "$srcdir/ucw/perl/";
-use UCW::Configure;
-
-Init($srcdir, "default.cfg");
-Include "ucw/default.cfg";
-Log "### Configuring TestApp ###\n\n";
-Include Get("CONFIG");
-require UCW::Configure::Paths;
-require UCW::Configure::C;
-require UCW::Configure::LibUCW;
-Finish();
-
-Log "\nConfigured, run `make' to build everything.\n";
diff --git a/free/libs/examples/internal/default.cfg b/free/libs/examples/internal/default.cfg
deleted file mode 100644 (file)
index a133ba2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Default configuration file for our test application
-
-# Do a local build
-Set("CONFIG_LOCAL");
-
-# We want to build all libraries shared
-Set("CONFIG_SHARED");
-
-# Liblang settings
-Set("CONFIG_LIBLANG");
-Set("CONFIG_LANG");
-Set("MAX_WORD_CHARS" => 64);
-Set("MAX_WORD_BYTES" => 192);
-
-# Libimages settings
-Set("CONFIG_IMAGES");
-Set("CONFIG_IMAGES_LIBJPEG");
-Set("CONFIG_IMAGES_LIBPNG");
-Set("CONFIG_IMAGES_LIBUNGIF");
-UnSet("CONFIG_IMAGES_LIBGIF");
-UnSet("CONFIG_IMAGES_LIBMAGICK");
-
-# Return success
-1;
diff --git a/free/libs/examples/internal/test.c b/free/libs/examples/internal/test.c
deleted file mode 100644 (file)
index 28e45c8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ucw/lib.h>
-
-int main(void)
-{
-  log_init("test");
-  msg(L_INFO, "Hoooot!");
-  return 0;
-}