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 -
 WINGs/Makefile.am        | 17 +++--------------
 WINGs/get-wings-flags    | 33 +++++++++++++++++++++++++++++++++
 WINGs/get-wings-flags.in | 31 -------------------------------
 doc/get-wings-flags.1    | 40 ++++++++++++++++++++--------------------
 5 files changed, 56 insertions(+), 66 deletions(-)
 create mode 100755 WINGs/get-wings-flags
 delete mode 100644 WINGs/get-wings-flags.in

diff --git a/.gitignore b/.gitignore
index a27a3b0..0e94104 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,7 +76,6 @@ WINGs/Tests/testmywidget
 WINGs/Tests/wmfile
 WINGs/Tests/wmquery
 WINGs/Tests/wtest
-WINGs/get-wings-flags
 
 WPrefs.app/WPrefs
 
diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am
index 1e4d8e9..79e6752 100644
--- a/WINGs/Makefile.am
+++ b/WINGs/Makefile.am
@@ -8,7 +8,7 @@ DIST_SUBDIRS = $(SUBDIRS) Tests Examples Extras
 libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@
 libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@
 
-bin_SCRIPTS = get-wings-flags get-wutil-flags
+dist_bin_SCRIPTS = get-wings-flags get-wutil-flags
 
 lib_LTLIBRARIES = libWUtil.la libWINGs.la
 
@@ -17,7 +17,7 @@ LDADD= libWUtil.la libWINGs.la 
$(top_builddir)/wrlib/libwraster.la @INTLIBS@
 libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ 
@XFTLIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@
 libWUtil_la_LIBADD = @LIBBSD@
 
-EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in 
get-wutil-flags
+EXTRA_DIST = BUGS make-rgb Examples Extras Tests
 
 
 # wbutton.c 
@@ -98,7 +98,7 @@ AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = WINGs.pc WUtil.pc
 
-DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags
+DISTCLEANFILES = $(pkgconfig_DATA)
 
 WINGs.pc: Makefile
        @echo "Generating $@"
@@ -110,17 +110,6 @@ WINGs.pc: Makefile
        @echo 'Libs.private: $(XFTLIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' 
>> $@
        @echo 'Cflags: $(inc_search_path)' >> $@
 
-get-wings-flags: get-wings-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#$${XFTLIBS}#$(XFTLIBS)#;' \
-               -e 's#$${PANGOLIBS}#$(PANGOLIBS)#;' \
-               -e 's#$${INTLIBS}#$(INTLIBS)#;' \
-               -e 's#$${XLIBS}#$(XLIBS)#;' < $(abs_srcdir)/get-wings-flags.in 
> $@
-       @chmod 755 $@
-
 WUtil.pc: Makefile
        @echo "Generating $@"
        @echo 'Name: WUtil' > $@
diff --git a/WINGs/get-wings-flags b/WINGs/get-wings-flags
new file mode 100755
index 0000000..c7342a0
--- /dev/null
+++ b/WINGs/get-wings-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 WINGs ...'" >&2
+      exit 1
+fi
+
+while test $# -gt 0; do
+  case $1 in
+    --cflags)
+        echo "Warning: $0 is deprecated, please use 'pkg-config WINGs 
--cflags'" >&2
+       pkg-config WINGs --cflags
+        ;;
+    --ldflags|--lflags)
+       echo "Warning: $0 is deprecated, please use 'pkg-config WINGs --libs'" 
>&2
+        pkg-config WINGs --libs-only-L
+        ;;
+    --libs)
+       echo "Warning: $0 is deprecated, please use 'pkg-config WINGs --libs'" 
>&2
+        pkg-config WINGs --libs
+        ;;
+    *)
+       echo "Error: $0 is deprecated, please use 'pkg-config WINGs ...'" >&2
+       exit 1
+       ;;
+  esac
+  shift
+done
diff --git a/WINGs/get-wings-flags.in b/WINGs/get-wings-flags.in
deleted file mode 100644
index 7218e00..0000000
--- a/WINGs/get-wings-flags.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-WCFLAGS="${inc_search_path}"
-WLFLAGS="${lib_search_path}"
-WLIBS="-lWINGs -lWUtil -lwraster ${GFXLIBS} ${XFTLIBS} ${XLIBS} -lm ${INTLIBS} 
${PANGOLIBS}"
-
-usage="Usage: get-wings-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
diff --git a/doc/get-wings-flags.1 b/doc/get-wings-flags.1
index 86675f3..fd8eb4d 100644
--- a/doc/get-wings-flags.1
+++ b/doc/get-wings-flags.1
@@ -1,32 +1,32 @@
 .TH "get-wings-flags" "1" "22 March 2005"
 .SH "NAME"
-\fBget-wings-flags\fR \- output libWINGs compile and linker flags
+\fBget-wings-flags\fP \- output libWINGs compiler and linker flags (deprecated)
 .PP
 .SH "SYNOPSIS"
-.B get-wings-flags \fR[ \fI\-\-cflags \fR] [ \fI\-\-ldflags \fR]
-[ \fI\-\-libs \fR]
-.PP
+.B pkg-config
+.R WINGs
+.I \-\-cflags
+.br
+.B pkg-config
+.R WINGs
+.I \-\-libs
 .SH "DESCRIPTION"
-\fBget-wings-flags \fR\- output include path, library search path or
-library archive names needed to compile and link with libWINGs.
-.PP
-.SH "OPTIONS"
+\fBget-wings-flags\fP used to provide the compilation and link flags for 
programs that use
+the \fIWINGs\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 libWINGs functions.
+.BR pkg-config " WINGs \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 libWINGs.
-.TP
-.B \-\-libs
-\fRoutput library archive names required to link object filed with libWINGs.
-.PP
+.BR pkg-config " WINGs \fI\-\-libs\fP"
+to get the flags for the linker
+.SH "IMPORTANT NOTE"
+As with every deprecated stuff, the script \fBget-wings-flags\fR will be 
removed soon,
+so you should update your script quickly while you know about it.
 .SH "AUTHOR"
-get-wings-flags is a part of Window Maker, wich was written by
+get-wings-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).
-- 
2.1.4


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

Reply via email to