Add pkg-config support, fixes #187.

This commit is contained in:
Roy Marples 2009-10-08 00:19:18 +01:00
parent 42ca23b878
commit 07f9be7b1c
8 changed files with 47 additions and 4 deletions

View File

@ -2,9 +2,7 @@
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name> # Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license. # All rights reserved. Released under the 2-clause BSD license.
NAME= openrc include Makefile.inc
VERSION= 0.5.0
PKG= ${NAME}-${VERSION}
SUBDIR= conf.d etc init.d man sh src SUBDIR= conf.d etc init.d man sh src
@ -16,6 +14,14 @@ _OLDNET_SH= case "${MKOLDNET}" in \
_OLDNET!= ${_OLDNET_SH} _OLDNET!= ${_OLDNET_SH}
SUBDIR+= ${_OLDNET}$(shell ${_OLDNET_SH}) SUBDIR+= ${_OLDNET}$(shell ${_OLDNET_SH})
# Build pkgconfig or not
_PKGCONFIG_SH= case "${MKPKGCONFIG}" in \
[Yy][Ee][Ss]|"") echo "pkgconfig";; \
*) echo "";; \
esac
_PKGCONFIG!= ${_PKGCONFIG_SH}
SUBDIR+= ${_PKGCONFIG}$(shell ${_PKGCONFIG_SH})
# We need to ensure that runlevels is done last # We need to ensure that runlevels is done last
SUBDIR+= runlevels SUBDIR+= runlevels

3
Makefile.inc Normal file
View File

@ -0,0 +1,3 @@
NAME= openrc
VERSION= 0.5.0
PKG= ${NAME}-${VERSION}

1
README
View File

@ -11,6 +11,7 @@ PROGLDFLAGS=-static
LIBNAME=lib64 LIBNAME=lib64
DESTDIR=/tmp/openrc-image DESTDIR=/tmp/openrc-image
MKPAM=pam MKPAM=pam
MKPKGCONFIG=no
MKTERMCAP=ncurses MKTERMCAP=ncurses
MKTERMCAP=termcap MKTERMCAP=termcap
MKOLDNET=yes MKOLDNET=yes

2
pkgconfig/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
einfo.pc
openrc.pc

11
pkgconfig/Makefile Normal file
View File

@ -0,0 +1,11 @@
DIR= ${LIBDIR}/pkgconfig
SRCS= einfo.pc.in openrc.pc.in
INC= einfo.pc openrc.pc
sed -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h
SED_EXTRA= -e 's:@VERSION@:${VERSION}:g'
MK= ../mk
include ../Makefile.inc
include ${MK}/scripts.mk

9
pkgconfig/einfo.pc.in Normal file
View File

@ -0,0 +1,9 @@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@LIB@
includedir=/usr/include
Name: einfo
Description: Pretty console informational display
Version: @VERSION@
Libs: -L${libdir} -leinfo

10
pkgconfig/openrc.pc.in Normal file
View File

@ -0,0 +1,10 @@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@LIB@
includedir=/usr/include
Name: OpenRC
Description: Universal init system
Version: @VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lrc

View File

@ -34,6 +34,7 @@ CPPFLAGS+= -I../includes -I../librc -I../libeinfo
LDFLAGS+= -L../librc -L../libeinfo LDFLAGS+= -L../librc -L../libeinfo
LDADD+= -lutil -lrc -leinfo LDADD+= -lutil -lrc -leinfo
include ../../Makefile.inc
MK= ../../mk MK= ../../mk
include ${MK}/debug.mk include ${MK}/debug.mk
include ${MK}/prog.mk include ${MK}/prog.mk
@ -46,7 +47,7 @@ include ${MK}/${MKPAM}.mk
${SRCS}: version.h ${SRCS}: version.h
version.h: version.h:
sed -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h echo "#define VERSION \"${VERSION}${GITVER}\"" >version.h
if test -n "${BRANDING}"; then \ if test -n "${BRANDING}"; then \
echo "#define BRANDING \"${BRANDING}\"" >> version.h; \ echo "#define BRANDING \"${BRANDING}\"" >> version.h; \
fi fi