tests for $ORIGIN

This commit is contained in:
christos 2007-05-18 21:41:38 +00:00
parent 89c9ca415d
commit d4ba6c5809
7 changed files with 56 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.1 2007/05/18 20:28:11 christos Exp $
# $NetBSD: Makefile,v 1.2 2007/05/18 21:41:38 christos Exp $
.include <bsd.own.mk>
SUBDIR+= expand
SUBDIR+= expand origin
.include <bsd.subdir.mk>

View File

@ -0,0 +1,3 @@
SUBDIR=lib prog
.include <bsd.subdir.mk>

View File

@ -0,0 +1,14 @@
# $NetBSD: Makefile,v 1.1 2007/05/18 21:41:39 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
USE_SHLIBDIR= yes
major=0
minor=0
NOMAN=1
LIB= foo
SRCS= foosrc.c
.include <bsd.own.mk>
.include <bsd.shlib.mk>
.include <bsd.lib.mk>

View File

@ -0,0 +1 @@
void foo(void);

View File

@ -0,0 +1,8 @@
#include <stdio.h>
#include "foo.h"
void
foo(void)
{
printf("foo\n");
}

View File

@ -0,0 +1,20 @@
.include <bsd.own.mk>
NOMAN=1
PROG=origin
LIBFOO != cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
LDFLAGS+=-Wl,-R'$${ORIGIN}' -Wl,-L${LIBFOO} -lfoo
CPPFLAGS+=-I${.CURDIR}/../lib
${PROG}: libfoo.so.0
libfoo.so.0:
cp ${LIBFOO}/libfoo.so.0 .
CLEANFILES+=libfoo.so
regress: ${PROG}
./${PROG}
.include <bsd.prog.mk>

View File

@ -0,0 +1,8 @@
#include "foo.h"
int
main(int argc, char *argv[])
{
foo();
return 0;
}