initial checkin
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 13 Oct 2003 19:50:29 +0000 (19:50 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 13 Oct 2003 19:50:29 +0000 (19:50 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@89 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/m4/pkgconfig.am [new file with mode: 0644]

diff --git a/util-vserver/m4/pkgconfig.am b/util-vserver/m4/pkgconfig.am
new file mode 100644 (file)
index 0000000..c864288
--- /dev/null
@@ -0,0 +1,55 @@
+## $Id$        ---*- makefile -*---
+
+## Copyright (C) 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+##  
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##  
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##  
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##  
+
+BAD_INC_PATHS          =  /usr/include|/usr/local/include
+BAD_LIB_PATHS          =  /usr/lib
+
+pkgconfdir              =  $(libdir)/pkgconfig
+pkgconf_DATA            =  $(addsuffix .pc, $(PKGCONFIG_FILES))
+
+CLEANFILES             += $(addsuffix .pc,       $(PKGCONFIG_FILES))
+EXTRA_DIST             += $(addsuffix .pc.subst, $(PKGCONFIG_FILES))
+
+
+%.pc:                  %.pc.subst Makefile
+                       rm -f $@
+                       @case '$(libdir)' in                                                    \
+                               $(BAD_LIB_PATHS))       libflags=;;                             \
+                               *)                      libflags='-L$${libdir} ';;              \
+                       esac;                                                                   \
+                       case '$(pkgincludedir)' in                                              \
+                               $(BAD_INC_PATHS))       pkgincflags=;;                          \
+                               *)                      pkgincflags='-I$${pkgincludedir} ';;    \
+                       esac;                                                                   \
+                       case '$(includedir)' in                                                 \
+                               $(BAD_INC_PATHS))       incflags=;;                             \
+                               *)                      incflags='-I$${includedir} ';;          \
+                       esac;                                                                   \
+                       sed -e 's!@'PACKAGE'@!$(PACKAGE)!g;                                     \
+                               s!@'VERSION'@!$(VERSION)!g;                                     \
+                               s!@'prefix'@!$(prefix)!g;                                       \
+                               s!@'exec_prefix'@!$(exec_prefix)!g;                             \
+                               s!@'libdir'@!$(libdir)!g;                                       \
+                               s!@'includedir'@!$(includedir)!g;                               \
+                               s!@'libflags"@!$${libflags}$(pkgconf_LIBFLAGS)!g;"'             \
+                               s!@'incflags"@!$${incflags}$(pkgconf_INCFLAGS)!g;"'             \
+                               s!@'pkgincflags"@!$${pkgincflags}$(pkgconf_PKGINCFLAGS)!g;"'    \
+                               s!@'pkgincludedir'@!$(pkgincludedir)!g'                         \
+                        $< >$@
+                       test -z "$(CHMOD_REFERENCE)" || $(CHMOD_REFERENCE) '$<' '$@'
+                       chmod a-w $@