dnl
dnl XA configuration
dnl
+if test "x$enable_xa" = xyes; then
+AC_PROG_AWK
+AC_PROG_GREP
+AC_CHECK_PROG(NM, nm, "nm")
+if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
+AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
+enable_xa=no
+fi
+fi
if test "x$enable_xa" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_XA=yes
+ AC_SUBST(AWK)
+ AC_SUBST(GREP)
+ AC_SUBST(NM)
fi
dnl
default: $(TOP)/$(LIB_DIR)/gallium/$(XA_LIB_NAME)
+# Generate list of library visible symbols
+xa_symbols: $(TOP)/src/gallium/state_trackers/xa/libxatracker.o
+ $(NM) $< | $(GREP) ' T ' | $(AWK) '{print $$3}' > $@
# Make the library
-$(TOP)/$(LIB_DIR)/gallium/$(XA_LIB_NAME): depend $(OBJECTS) $(XA_LIB_DEPS)
+$(TOP)/$(LIB_DIR)/gallium/$(XA_LIB_NAME): depend $(OBJECTS) $(XA_LIB_DEPS) \
+ xa_symbols
$(MKLIB) -o $(XA_LIB) -linker $(LD) -ldflags '$(LDFLAGS)' \
-major $(XA_MAJOR) -minor $(XA_MINOR) -patch $(XA_TINY) \
$(MKLIB_OPTIONS) \
- -exports $(TOP)/src/gallium/state_trackers/xa/xa_symbols\
+ -exports xa_symbols \
-install $(TOP)/$(LIB_DIR)/gallium \
$(OBJECTS) $(XA_LIB_DEPS) $(GALLIUM_AUXILIARIES)
-rm -f *.la
-rm -f *.pc
-rm -rf .libs
- -rm -f depend depend.bak exptmp
+ -rm -f depend depend.bak exptmp xa_symbols
depend: $(SOURCES)