# per-target settings will be applied
CC_CFLAGS=$(PTHREAD_CFLAGS) $(ASTCFLAGS)
CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(ASTCFLAGS))
-CC_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK)
-CXX_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK)
+
+ifeq ($(GNU_LD),1)
+SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(if $(wildcard $(subst .so,.exports,$@)),$(subst .so,.exports,$@),$(ASTTOPDIR)/default.exports)
+endif
+
+CC_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS)
+CXX_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS)
CC_LIBS=$(PTHREAD_LIBS) $(LIBS)
CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
+++ /dev/null
-#!/bin/sh -e
-
-# This script is designed to remove all non-API global symbols from an object
-# file. The only global symbols that should be retained are those that belong
-# to the official namespace. Unfortunately doing this is platform-specific, as
-# the object file manipulation tools are not consistent across platforms.
-#
-# On platforms where this script does not know what to do, the object file
-# will retain non-API global symbols, and this may have unpleasant side effects.
-#
-# Prefixes that belong to the official namespace are:
-# ast_
-# _ast_
-# __ast_
-# astman_
-# pbx_
-
-case "${PROC}" in
- powerpc64)
- TEXTSYM=" D "
- ;;
- *)
- TEXTSYM=" T "
- ;;
-esac
-
-FILTER="${GREP} -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_"
-
-case "${OSARCH}" in
- linux-gnu)
- nm ${1} | ${GREP} -e "$TEXTSYM" | cut -d" " -f3 | ${FILTER} > striplist
- sed -e "s/^/-N /" striplist | xargs -n 40 ${STRIP} ${1}
- rm -f striplist
- ;;
- *)
- ;;
-esac
--- /dev/null
+{
+ local:
+ *;
+};
#ifndef DEBUG_THREADS
int ao2_lock(void *a);
#else
-#define ao2_lock(a) _ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
-int _ao2_lock(void *a, const char *file, const char *func, int line, const char *var);
+#define ao2_lock(a) __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
+int __ao2_lock(void *a, const char *file, const char *func, int line, const char *var);
#endif
#ifndef DEBUG_THREADS
int ao2_trylock(void *a);
#else
-#define ao2_trylock(a) _ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
-int _ao2_trylock(void *a, const char *file, const char *func, int line, const char *var);
+#define ao2_trylock(a) __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
+int __ao2_trylock(void *a, const char *file, const char *func, int line, const char *var);
#endif
/*!
#ifndef DEBUG_THREADS
int ao2_unlock(void *a);
#else
-#define ao2_unlock(a) _ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
-int _ao2_unlock(void *a, const char *file, const char *func, int line, const char *var);
+#define ao2_unlock(a) __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
+int __ao2_unlock(void *a, const char *file, const char *func, int line, const char *var);
#endif
/*!
ASTLINK=
endif
+ifeq ($(GNU_LD),1)
+ASTLINK+=-Wl,--version-script,asterisk.exports
+endif
+
editline/libedit.a:
cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(ASTCFLAGS:-Werror=))" LDFLAGS="$(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR)
$(MAKE) -C editline libedit.a
H323LDLIBS=
endif
-asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) asterisk.exports
@$(ASTTOPDIR)/build_tools/make_build_h > $(ASTTOPDIR)/include/asterisk/build.h.tmp
@if cmp -s $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; then echo ; else \
mv $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; \
fi
@rm -f $(ASTTOPDIR)/include/asterisk/build.h.tmp
@$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
- $(ECHO_PREFIX) echo " [LD] $^ -> $@"
+ $(ECHO_PREFIX) echo " [LD] $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) -> $@"
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
- $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS)
+ $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS)
else
- $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
+ $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
endif
- $(CMD_PREFIX) $(ASTTOPDIR)/build_tools/strip_nonapi $@ || rm $@
clean::
rm -f asterisk
--- /dev/null
+{
+ global:
+ ast_*;
+ _ast_*;
+ __ast_*;
+ pbx_*;
+ astman_*;
+ ao2_*;
+ __ao2_*;
+ option_debug;
+ option_verbose;
+ dahdi_chan_name;
+ dahdi_chan_name_len;
+ dahdi_chan_mode;
+ cid_di;
+ cid_dr;
+ clidsb;
+ MD5*;
+ sched_*;
+ io_*;
+ jb_*;
+ channelreloadreason2txt;
+ devstate2str;
+ manager_event;
+ dialed_interface_info;
+ local:
+ *;
+};
#ifndef DEBUG_THREADS
int ao2_lock(void *user_data)
#else
-int _ao2_lock(void *user_data, const char *file, const char *func, int line, const char *var)
+int __ao2_lock(void *user_data, const char *file, const char *func, int line, const char *var)
#endif
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
#ifndef DEBUG_THREADS
int ao2_trylock(void *user_data)
#else
-int _ao2_trylock(void *user_data, const char *file, const char *func, int line, const char *var)
+int __ao2_trylock(void *user_data, const char *file, const char *func, int line, const char *var)
#endif
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
#ifndef DEBUG_THREADS
int ao2_unlock(void *user_data)
#else
-int _ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var)
+int __ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var)
#endif
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
PTHREAD_CFLAGS=@PTHREAD_CFLAGS@
PTHREAD_LIBS=@PTHREAD_LIBS@
+GNU_LD=@GNU_LD@
+
prefix = @prefix@
exec_prefix = @exec_prefix@
--- /dev/null
+{
+ global:
+ ast_adsi_available;
+ ast_adsi_begin_download;
+ ast_adsi_channel_restore;
+ ast_adsi_clear_screen;
+ ast_adsi_clear_soft_keys;
+ ast_adsi_connect_session;
+ ast_adsi_data_mode;
+ ast_adsi_disconnect_session;
+ ast_adsi_display;
+ ast_adsi_download_connect;
+ ast_adsi_download_disconnect;
+ ast_adsi_end_download;
+ ast_adsi_get_cpeid;
+ ast_adsi_get_cpeinfo;
+ ast_adsi_input_control;
+ ast_adsi_input_format;
+ ast_adsi_load_session;
+ ast_adsi_load_soft_key;
+ ast_adsi_print;
+ ast_adsi_query_cpeid;
+ ast_adsi_query_cpeinfo;
+ ast_adsi_read_encoded_dtmf;
+ ast_adsi_set_keys;
+ ast_adsi_set_line;
+ ast_adsi_transmit_message;
+ ast_adsi_transmit_message_full;
+ ast_adsi_unload_session;
+ ast_adsi_voice_mode;
+ local:
+ *;
+};
--- /dev/null
+{
+ global:
+ ast_agi_register;
+ ast_agi_unregister;
+ local:
+ *;
+};
return 0;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "ODBC Configuration",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ODBC Configuration",
.load = load_module,
.unload = unload_module,
);
}
/* needs usecount semantics defined */
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "PostgreSQL RealTime Configuration Driver",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "PostgreSQL RealTime Configuration Driver",
.load = load_module,
.unload = unload_module,
.reload = reload
}
/* needs usecount semantics defined */
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Cryptographic Digital Signatures",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Cryptographic Digital Signatures",
.load = load_module,
.unload = unload_module,
.reload = reload
--- /dev/null
+{
+ global:
+ ast_bridge_call;
+ ast_masq_park_call;
+ ast_park_call;
+ ast_parking_ext;
+ ast_pickup_call;
+ ast_pickup_ext;
+ ast_register_feature;
+ ast_unregister_feature;
+ local:
+ *;
+};
return ind_load_module();
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Indications Resource",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Indications Resource",
.load = load_module,
.unload = unload_module,
.reload = reload,
--- /dev/null
+{
+ global:
+ ast_aji_create_chat;
+ ast_aji_disconnect;
+ ast_aji_get_client;
+ ast_aji_get_clients;
+ ast_aji_increment_mid;
+ ast_aji_invite_chat;
+ ast_aji_join_chat;
+ ast_aji_send;
+ local:
+ *;
+};
--- /dev/null
+{
+ global:
+ ast_monitor_change_fname;
+ ast_monitor_pause;
+ ast_monitor_setjoinfiles;
+ ast_monitor_start;
+ ast_monitor_stop;
+ ast_monitor_unpause;
+ local:
+ *;
+};
return res;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Music On Hold Resource",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Music On Hold Resource",
.load = load_module,
.unload = unload_module,
.reload = reload,
--- /dev/null
+{
+ global:
+ ast_odbc_backslash_is_escape;
+ ast_odbc_prepare_and_execute;
+ ast_odbc_release_obj;
+ ast_odbc_request_obj;
+ ast_odbc_sanity_check;
+ ast_odbc_smart_execute;
+ local:
+ *;
+};
--- /dev/null
+{
+ global:
+ ast_smdi_interface_find;
+ ast_smdi_interface_unref;
+ ast_smdi_md_message_destroy;
+ ast_smdi_md_message_pop;
+ ast_smdi_md_message_putback;
+ ast_smdi_md_message_wait;
+ ast_smdi_mwi_message_destroy;
+ ast_smdi_mwi_message_pop;
+ ast_smdi_mwi_message_putback;
+ ast_smdi_mwi_message_wait;
+ ast_smdi_mwi_message_wait_station;
+ ast_smdi_mwi_set;
+ ast_smdi_mwi_unset;
+ local:
+ *;
+};
return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0);
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "SNMP [Sub]Agent for Asterisk",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "SNMP [Sub]Agent for Asterisk",
.load = load_module,
.unload = unload_module,
);
--- /dev/null
+{
+ global:
+ ast_speech_change;
+ ast_speech_change_results_type;
+ ast_speech_change_state;
+ ast_speech_destroy;
+ ast_speech_dtmf;
+ ast_speech_grammar_activate;
+ ast_speech_grammar_deactivate;
+ ast_speech_grammar_load;
+ ast_speech_grammar_unload;
+ ast_speech_new;
+ ast_speech_register;
+ ast_speech_results_free;
+ ast_speech_results_get;
+ ast_speech_start;
+ ast_speech_unregister;
+ ast_speech_write;
+ local:
+ *;
+};