diff --git a/Makefile.am b/Makefile.am index e26b21e0c7..eb10f9810a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -133,8 +133,8 @@ endif ## lib_LTLIBRARIES = libfreeswitch.la libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(AM_CFLAGS) -libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_DEPLIBS) -libfreeswitch_la_LIBADD = $(CORE_LIBS) +libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) +libfreeswitch_la_LIBADD = $(CORE_LIBS) $(PLATFORM_CORE_LIBS) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) if HAVE_ODBC @@ -299,16 +299,16 @@ endif ## fs_encode_SOURCES = src/fs_encode.c fs_encode_CFLAGS = $(AM_CFLAGS) -fs_encode_LDFLAGS = $(AM_LDFLAGS) $(CORE_LIBS) -fs_encode_LDADD = libfreeswitch.la -lcrypt -lrt +fs_encode_LDFLAGS = $(AM_LDFLAGS) +fs_encode_LDADD = libfreeswitch.la ## ## tone2wav () ## tone2wav_SOURCES = src/tone2wav.c tone2wav_CFLAGS = $(AM_CFLAGS) -tone2wav_LDFLAGS = $(AM_LDFLAGS) $(CORE_LIBS) -tone2wav_LDADD = libfreeswitch.la -lcrypt -lrt +tone2wav_LDFLAGS = $(AM_LDFLAGS) +tone2wav_LDADD = libfreeswitch.la ## ## fs_ivrd () diff --git a/configure.in b/configure.in index cb2abd9d12..c369a7986b 100644 --- a/configure.in +++ b/configure.in @@ -407,7 +407,8 @@ APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv) fi ESL_LDFLAGS= -PLATFORM_CORE_DEPLIBS= +PLATFORM_CORE_LDFLAGS= +PLATFORM_CORE_LIBS= # tweak platform specific flags case "$host" in *darwin10.*) @@ -417,23 +418,30 @@ case "$host" in APR_ADDTO(CXXFLAGS, -pipe) APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC) if test "x$enable_core_odbc_support" != "xno"; then - APR_ADDTO(PLATFORM_CORE_DEPLIBS, --framework CoreFoundation) + APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation]) fi + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt]) ;; *darwin*) APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX) APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC) if test "x$enable_core_odbc_support" != "xno"; then - APR_ADDTO(PLATFORM_CORE_DEPLIBS, --framework CoreFoundation) + APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation]) fi + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt]) ;; *-solaris2*) APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__) APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid) APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket) + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid]) ;; *bsd*) APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include) + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt]) + ;; + *linux*) + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt]) ;; esac @@ -444,7 +452,8 @@ AC_SUBST(SWITCH_ANSI_CFLAGS) AC_SUBST(SWITCH_AM_CXXFLAGS) AC_SUBST(SWITCH_AM_LDFLAGS) AC_SUBST(ESL_LDFLAGS) -AC_SUBST(PLATFORM_CORE_DEPLIBS) +AC_SUBST(PLATFORM_CORE_LDFLAGS) +AC_SUBST(PLATFORM_CORE_LIBS) AC_SUBST(SOLINK) AC_SUBST(DYNAMIC_LIB_EXTEN) AC_SUBST(LIBTOOL_LIB_EXTEN)