1
2#include <dlfcn.h>
3#include <stdio.h>
4#include <stdlib.h>
5
6#ifndef LIBANAME
7#error "LIBANAME undefined"
8#endif
9
10#ifndef LIBBNAME
11#error "LIBBNAME undefined"
12#endif
13
14int
15main(int argc, char *argv[])
16{
17	void *handle;
18
19	printf("opening\n");
20	if ((handle = dlopen(LIBANAME, RTLD_NOW|RTLD_NOLOAD)))
21		printf("%s found\n", LIBANAME);
22	else if ((handle = dlopen(LIBBNAME, RTLD_NOW|RTLD_NOLOAD)))
23		printf("%s found\n", LIBBNAME);
24
25	return 0;
26}
27