1119N/Adiff --git a/src/Makefile.am b/src/Makefile.am
1447N/Aindex 26ceda7..3fe220b 100644
1119N/A--- a/src/Makefile.am
1119N/A+++ b/src/Makefile.am
1447N/A@@ -175,3 +175,40 @@ EXTRA_DIST = \
999N/A radeon_atombios.h \
999N/A radeon_dri2.h \
999N/A drmmode_display.h
606N/A+
606N/A+# Generate linker mapfiles for symbols found in other modules and use them
606N/A+# and library flag additions to make sure all symbols are resolvable
606N/A+
606N/A+radeon_MAPFILES = \
606N/A+ mapfile-theatre_detect_drv-external \
851N/A+ mapfile-theatre_drv-external \
851N/A+ mapfile-tda9885_drv-external \
851N/A+ mapfile-msp3430_drv-external \
851N/A+ mapfile-uda1380_drv-external \
851N/A+ mapfile-fi1236_drv-external \
851N/A+ mapfile-bt829_drv-external
606N/A+
606N/A+radeon_drv_la_LDFLAGS += $(radeon_MAPFILES:%=-Wl,-M,%) \
1447N/A+ $(radeon_drv_la_LDFLAGS_add) \
1351N/A+ -lexa -lfb -lint10 -lvbe -lvgahw -lshadow \
1351N/A+ -lpixman-1 -ldrm -lglx -lm
606N/A+
606N/A+radeon_drv_la_DEPENDENCIES = $(radeon_MAPFILES)
606N/A+
606N/A+mapfiles: $(MAPFILES)
606N/A+
606N/A+mapfile-theatre_drv-external: $(theatre_drv_la_OBJECTS)
606N/A+mapfile-theatre_detect_drv-external: $(theatre_detect_drv_la_OBJECTS)
851N/A+mapfile-bt829_drv-external: $(bt829_drv_la_OBJECTS)
851N/A+mapfile-fi1236_drv-external: $(fi1236_drv_OBJECTS)
851N/A+mapfile-uda1380_drv-external: $(uda1380_drv_OBJECTS)
851N/A+mapfile-msp3430_drv-external: $(msp3430_drv_OBJECTS)
851N/A+mapfile-tda9885_drv-external: $(tda9885_drv_OBJECTS)
606N/A+
606N/A+mapfile-%-external:
606N/A+ -rm -f $@
606N/A+ printf '# Functions exported to loadable modules\n\n' > $@
606N/A+ printf '{\n global:\n' >> $@
606N/A+ /usr/ccs/bin/nm -g $? | grep -v UNDEF | sed -n -e 's/^.*\|FUNC \|GLOB \|.*\|\(.*\)$$/ \1 = FUNCTION extern;/p' -e 's/^.*\|OBJT \|GLOB \|.*\|\(.*\)$$/ \1 = DATA extern;/p' >> $@
606N/A+ printf '};\n' >> $@
606N/A+