1 |
|
## Process this file with automake to produce Makefile.in |
2 |
|
|
3 |
|
AUTOMAKE_OPTIONS = no-dependencies foreign |
4 |
|
|
5 |
|
EXTRA_DIST = acinclude.m4 |
6 |
|
|
7 |
|
# Build a libtool library, libhello.la for installation in libdir. |
8 |
|
lib_LTLIBRARIES = libhello.la |
9 |
|
libhello_la_SOURCES = longer_file_name_hello.c longer_file_name_foo.c longer_file_name_foo2.c |
10 |
|
libhello_la_LIBADD = $(LIBM) |
11 |
|
libhello_la_LDFLAGS = -version-info 3:12:1 |
12 |
|
|
13 |
|
include_HEADERS = foo.h |
14 |
|
|
15 |
|
if BINARY_HELLDL |
16 |
|
BUILD_helldl = helldl |
17 |
|
else |
18 |
|
BUILD_helldl = |
19 |
|
endif |
20 |
|
|
21 |
|
bin_PROGRAMS = hell hell.static $(BUILD_helldl) |
22 |
|
|
23 |
|
# Build hell from longer_file_name_main.c and libhello.la |
24 |
|
hell_SOURCES = longer_file_name_main.c |
25 |
|
hell_LDADD = libhello.la |
26 |
|
|
27 |
|
# Create a statically linked version of hell. |
28 |
|
hell_static_SOURCES = longer_file_name_main.c |
29 |
|
hell_static_LDADD = libhello.la |
30 |
|
hell_static_LDFLAGS = $(STATIC) |
31 |
|
|
32 |
|
if BINARY_HELLDL |
33 |
|
|
34 |
|
# Create a version of hell that does a preloaded dlopen. |
35 |
|
helldl_SOURCES = longer_file_name_dlmain.c |
36 |
|
helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la |
37 |
|
helldl_DEPENDENCIES = libhello.la |
38 |
|
|
39 |
|
else |
40 |
|
|
41 |
|
bin_SCRIPTS = helldl |
42 |
|
# create a script that says that -dlopen is not supported |
43 |
|
helldl: |
44 |
|
rm -f $@ |
45 |
|
echo '#! /bin/sh' > $@ |
46 |
|
echo '-dlopen is unsupported' >> $@ |
47 |
|
chmod +x $@ |
48 |
|
endif |
49 |
|
|
50 |
|
$(OBJECTS): libtool |
51 |
|
libtool: $(LIBTOOL_DEPS) |
52 |
|
$(SHELL) ./config.status --recheck |
53 |
|
|
54 |
|
#---------------------------------------------------------------------- |
55 |
|
# The following declarations are only used in the testsuite: |
56 |
|
#---------------------------------------------------------------------- |
57 |
|
|
58 |
|
hardcode_tests = hc-direct hc-libflag hc-libpath hc-minusL |
59 |
|
CLEANFILES = $(hardcode_tests) |
60 |
|
|
61 |
|
# Unfortunately, in order to test libtool thoroughly, we need access |
62 |
|
# to its private directory. |
63 |
|
objdir = `$(LIBTOOL) --config | sed -n -e 's/^objdir=\(.*\)$$/\1/p'` |
64 |
|
|
65 |
|
# The following rules are only for the libtool demo and tests. |
66 |
|
# Regenerate our acinclude.m4 only if it doesn't exist. |
67 |
|
$(srcdir)/acinclude.m4: |
68 |
|
rm -f $(srcdir)/acinclude.m4 |
69 |
|
cd $(srcdir) && $(LN_S) ../libtool.m4 acinclude.m4 |
70 |
|
|
71 |
|
|
72 |
|
# Test programs to see what gets hardcoded. |
73 |
|
.PHONY: hardcode |
74 |
|
hardcode: $(hardcode_tests) |
75 |
|
SET_HARDCODE_FLAGS = eval `$(LIBTOOL) --config | egrep -e '^(hardcode_.*|wl)='` |
76 |
|
hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la |
77 |
|
@rm -f hc-direct |
78 |
|
@echo "You may ignore any linking errors from the following command:" |
79 |
|
@shlib=./$(objdir)/libhello.a; \ |
80 |
|
eval "`egrep '^library_names' libhello.la`"; \ |
81 |
|
for lib in $$library_names; do \ |
82 |
|
shlib="./$(objdir)/$$lib"; \ |
83 |
|
done; \ |
84 |
|
$(SET_HARDCODE_FLAGS); \ |
85 |
|
libdir=$(libdir); \ |
86 |
|
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ |
87 |
|
echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \ |
88 |
|
eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@" |
89 |
|
|
90 |
|
hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la |
91 |
|
@$(SET_HARDCODE_FLAGS); \ |
92 |
|
libdir=`pwd`/$(objdir); \ |
93 |
|
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ |
94 |
|
if test -z "$$flag"; then \ |
95 |
|
echo "echo unsupported > $@"; \ |
96 |
|
echo unsupported > $@ || status="$$?"; \ |
97 |
|
else \ |
98 |
|
echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM)"; \ |
99 |
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM) || status="$$?"; \ |
100 |
|
fi; \ |
101 |
|
exit $$status |
102 |
|
|
103 |
|
hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la |
104 |
|
@rm -f hc-libpath |
105 |
|
@echo "You may ignore any linking errors from the following command:" |
106 |
|
@$(SET_HARDCODE_FLAGS); \ |
107 |
|
eval `$(LIBTOOL) --config | grep '^shlibpath_var='`; \ |
108 |
|
libdir=$(libdir); \ |
109 |
|
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ |
110 |
|
echo "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \ |
111 |
|
eval "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@" |
112 |
|
|
113 |
|
hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES) |
114 |
|
@rm -f hc-minusL |
115 |
|
@$(SET_HARDCODE_FLAGS); \ |
116 |
|
libdir=$(libdir); \ |
117 |
|
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \ |
118 |
|
echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \ |
119 |
|
eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@" |
120 |
|
|
121 |
|
# This is one of the essential tests for deplibs_check_method=pass_all. |
122 |
|
# If this one passes with pass_all, it is likely that pass_all works |
123 |
|
EXTRA_LIBRARIES = libhell0.a |
124 |
|
libhell0_a_SOURCES = longer_file_name_hello.c longer_file_name_foo.c |
125 |
|
EXTRA_LTLIBRARIES += libhell1.la libhell2.la |
126 |
|
libhell1_la_SOURCES = longer_file_name_hell1.c |
127 |
|
libhell1_la_LIBADD = -L. -lhell0 |
128 |
|
libhell1_la_LDFLAGS = -rpath $(libdir) |
129 |
|
libhell1_la_DEPENDENCIES = libhell0.a |
130 |
|
libhell2_la_SOURCES = longer_file_name_hell2.c |
131 |
|
libhell2_la_LIBADD = -L. -lhell0 |
132 |
|
libhell2_la_LDFLAGS = -rpath $(libdir) |
133 |
|
libhell2_la_DEPENDENCIES = libhell0.a |
134 |
|
EXTRA_PROGRAMS += hell0 |
135 |
|
hell0_SOURCES = longer_file_name_main.c |
136 |
|
hell0_LDADD = libhell1.la libhell2.la $(LIBM) |
137 |
|
|
138 |
|
CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) |
139 |
|
|
140 |
|
deplibs-check: hell0 |