This script should have been removed a long time ago, in favour of
pkg-config which has to be present anyway to compile Window Maker.

This patch makes the script print a warning about it, and now calls itself
pkg-config, instead of being generated; the man page was also updated
accordingly (and spell-checked).

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 .gitignore                 |  1 -
 doc/get-wraster-flags.1    | 42 ++++++++++++++++++++++--------------------
 wrlib/Makefile.am          | 13 +++----------
 wrlib/get-wraster-flags    | 33 +++++++++++++++++++++++++++++++++
 wrlib/get-wraster-flags.in | 31 -------------------------------
 5 files changed, 58 insertions(+), 62 deletions(-)
 create mode 100755 wrlib/get-wraster-flags
 delete mode 100644 wrlib/get-wraster-flags.in

diff --git a/.gitignore b/.gitignore
index 79d7aff..7f81a87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,7 +61,6 @@ util/wmsetup
 util/wxcopy
 util/wxpaste
 
-wrlib/get-wraster-flags
 wrlib/tests/testdraw
 wrlib/tests/testgrad
 wrlib/tests/testrot
diff --git a/doc/get-wraster-flags.1 b/doc/get-wraster-flags.1
index 08075b4..5b9b105 100644
--- a/doc/get-wraster-flags.1
+++ b/doc/get-wraster-flags.1
@@ -1,32 +1,34 @@
 .TH "get-wraster-flags" "1" "22 March 2005"
 .SH "NAME"
-\fBget-wraster-flags\fR \- output libwraster compile and linker flags
+\fBget-wraster-flags\fP \- output libwraster compiler and linker flags 
(deprecated)
 .PP
 .SH "SYNOPSIS"
-.B get-wraster-flags \fR[ \fI\-\-cflags \fR] [ \fI\-\-ldflags \fR]
-[ \fI\-\-libs \fR]
-.PP
+.B pkg-config
+.R wrlib
+.I \-\-cflags
+.br
+.B pkg-config
+.R wrlib
+.I \-\-libs
 .SH "DESCRIPTION"
-\fBget-wraster-flags \fR\- output include path, library search path or
-library archive names needed to compile and link with libwraster.
-.PP
-.SH "OPTIONS"
+\fBget-wraster-flags\fP used to provide the compilation and link flags for 
programs that use
+the \fIWRaster\fP library, before \fBpkg-config\fP became the universal way to 
handle these
+developer configurations. The script is now deprecated and you should use 
instead:
 .TP
-.B \-\-cflags
-\fRoutput include file search path to find all header files needed to compile
-source code using libwraster functions.
+.BR pkg-config " wrlib \fI\-\-cflags\fP"
+to get the flags for the compiler
 .TP
-.B \-\-ldflags
-\fRoutput library search path required to find all library archives needed to
-link object files with libwraster.
-.TP
-.B \-\-libs
-\fRoutput library archive names required to link object filed with libwraster.
-.PP
+.BR pkg-config " wrlib \fI\-\-libs\fP"
+to get the flags for the linker
+.SH "IMPORTANT NOTE"
+As with every deprecated stuff, the script \fBget-wraster-flags\fR will be 
removed soon,
+so you should update your script quickly while you know about it.
 .SH "AUTHOR"
-get-wraster-flags is a part of Window Maker, wich was written by
+get-wraster-flags is part of Window Maker, which was written by
 Alfredo K. Kojima <koj...@windowmaker.info> and Dan Pascu 
<d...@windowmaker.info>,
 with contributions from many people around the Internet.
 .PP
-This manpage was written by Frederik Schueler <fschue...@gmx.net> for the
+This man page was written by Frederik Schueler <fschue...@gmx.net> for the
 Debian GNU/Linux system (but may be used by others).
+.SH "SEE ALSO"
+.BR pkg-config (1)
diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index 575a815..ee1c04d 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -5,7 +5,7 @@ DIST_SUBDIRS = $(SUBDIRS) tests
 
 AUTOMAKE_OPTIONS =
 
-EXTRA_DIST = tests get-wraster-flags.in
+EXTRA_DIST = tests
 
 lib_LTLIBRARIES = libwraster.la
 
@@ -17,7 +17,7 @@ EXTRA_libwraster_la_DEPENDENCIES = libwraster.map
 CLEANFILES = libwraster.map
 endif
 
-bin_SCRIPTS = get-wraster-flags
+dist_bin_SCRIPTS = get-wraster-flags
 
 include_HEADERS = wraster.h
 
@@ -84,7 +84,7 @@ libwraster_la_LIBADD = @LIBRARY_SEARCH_PATH@ @GFXLIBS@ 
@MAGICKLIBS@ @XLIBS@ @LIB
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = wrlib.pc
 
-DISTCLEANFILES = $(pkgconfig_DATA) get-wraster-flags
+DISTCLEANFILES = $(pkgconfig_DATA)
 
 wrlib.pc: Makefile
        @echo "Generating $@"
@@ -95,13 +95,6 @@ wrlib.pc: Makefile
        @echo 'Libs.private: $(GFXLIBS) $(MAGICKLIBS) $(XLIBS) -lm' >> $@
        @echo 'Cflags: $(inc_search_path)' >> $@
 
-get-wraster-flags: get-wraster-flags.in Makefile
-       @echo "Generating $@"
-       @$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \
-               -e 's#$${lib_search_path}#$(lib_search_path)#;' \
-               -e 's#$${GFXLIBS}#$(GFXLIBS)#;' \
-               -e 's#$${XLIBS}#$(XLIBS)#;' < 
$(abs_srcdir)/get-wraster-flags.in > $@
-       @chmod 755 $@
 
 if HAVE_LD_VERSION_SCRIPT
 libwraster.map: $(include_HEADERS) 
$(top_srcdir)/script/generate-mapfile-from-header.sh
diff --git a/wrlib/get-wraster-flags b/wrlib/get-wraster-flags
new file mode 100755
index 0000000..ed245b9
--- /dev/null
+++ b/wrlib/get-wraster-flags
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# [Christophe CURIS, 2015/01/31]
+# This script is now reporting itself as deprecated (this should have been done
+# a long time ago), so it should be kept for at least 2 years from now in order
+# to allow users to update their scripts, and then removed.
+
+if test $# -eq 0; then
+      echo "Error: $0 is deprecated, please use 'pkg-config wrlib ...'" >&2
+      exit 1
+fi
+
+while test $# -gt 0; do
+  case $1 in
+    --cflags)
+        echo "Warning: $0 is deprecated, please use 'pkg-config wrlib 
--cflags'" >&2
+       pkg-config wrlib --cflags
+        ;;
+    --ldflags|--lflags)
+       echo "Warning: $0 is deprecated, please use 'pkg-config wrlib --libs'" 
>&2
+        pkg-config wrlib --libs-only-L
+        ;;
+    --libs)
+       echo "Warning: $0 is deprecated, please use 'pkg-config wrlib --libs'" 
>&2
+        pkg-config wrlib --libs
+        ;;
+    *)
+       echo "Error: $0 is deprecated, please use 'pkg-config wrlib ...'" >&2
+       exit 1
+       ;;
+  esac
+  shift
+done
diff --git a/wrlib/get-wraster-flags.in b/wrlib/get-wraster-flags.in
deleted file mode 100644
index a8cdd1a..0000000
--- a/wrlib/get-wraster-flags.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-WCFLAGS="${inc_search_path}"
-WLFLAGS="${lib_search_path}"
-WLIBS="-lwraster ${GFXLIBS} ${XLIBS} -lm"
-
-usage="Usage: get-wraster-flags [--cflags] [--ldflags] [--libs]"
-
-if test $# -eq 0; then
-      echo "${usage}" 1>&2
-      exit 1
-fi
-
-while test $# -gt 0; do
-  case $1 in
-    --cflags)
-       echo $WCFLAGS
-        ;;
-    --ldflags|--lflags)
-       echo $WLFLAGS
-        ;;
-    --libs)
-       echo $WLIBS
-        ;;
-    *)
-       echo "${usage}" 1>&2
-       exit 1
-       ;;
-  esac
-  shift
-done
-- 
2.1.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to