Ticket #43231: patch-configure.ac.diff

File patch-configure.ac.diff, 3.3 KB (added by jul_bsd@…, 10 years ago)
  • configure.ac

    old new  
    517517LIBS=$old_LIBS
    518518
    519519dnl ***************************************************************************
     520dnl linker properties
     521dnl ***************************************************************************
     522
     523ac_save_LDFLAGS=$LDFLAGS
     524AC_CACHE_CHECK(whether $LD supports --whole-archive,
     525        ac_cv_prog_ld_whole_archive,
     526        [ac_cv_prog_ld_whole_archive=no
     527         LDFLAGS="$LDFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
     528         _AC_LINK_IFELSE([AC_LANG_PROGRAM()],
     529                [ac_cv_prog_ld_whole_archive=yes], [])
     530         dnl AC_TRY_LINK(, [return 0], [ac_cv_prog_ld_whole_archive=yes], [])
     531        ])
     532LDFLAGS=$ac_save_LDFLAGS
     533
     534if test "x$ac_cv_prog_ld_whole_archive" = "xno"; then
     535  AC_CACHE_CHECK(whether $LD supports -all_libs,
     536          ac_cv_prog_ld_all_libs,
     537          [ac_cv_prog_ld_all_libs=no
     538           LDFLAGS="$LDFLAGS -Wl,-all_libs"
     539           _AC_LINK_IFELSE([AC_LANG_PROGRAM()],
     540                  [ac_cv_prog_ld_all_libs=yes], [])
     541          ])
     542  LDFLAGS=$ac_save_LDFLAGS
     543fi
     544
     545if test "x$ac_cv_prog_ld_whole_archive" = "xyes"; then
     546   LD_WHOLE_ARCHIVE="-Wl,--whole-archive"
     547   LD_NO_WHOLE_ARCHIVE="-Wl,--no-whole-archive"
     548fi
     549
     550if test "x$ac_cv_prog_ld_all_libs" = "xyes"; then
     551   LD_WHOLE_ARCHIVE="-Wl,-all_libs"
     552   LD_NO_WHOLE_ARCHIVE=""
     553fi
     554
     555dnl ***************************************************************************
    520556dnl libevtlog headers/libraries
    521557dnl ***************************************************************************
    522558PKG_CHECK_MODULES(EVTLOG, eventlog >= $EVTLOG_MIN_VERSION,,)
     
    813849                # these can only be used in lib as it assumes
    814850                # the current directory just one below ivykis
    815851
    816                 IVYKIS_LIBS="-Wl,--whole-archive -L\$(top_builddir)/lib/ivykis/src -livykis  -Wl,--no-whole-archive"
     852                IVYKIS_LIBS="${LD_WHOLE_ARCHIVE} -L\$(top_builddir)/lib/ivykis/src -livykis  ${LD_NO_WHOLE_ARCHIVE}"
    817853                IVYKIS_CFLAGS="-I\$(top_srcdir)/lib/ivykis/src/include -I\$(top_builddir)/lib/ivykis/src/include"
    818854                IVYKIS_SUBDIRS=lib/ivykis
    819855                INTERNAL_IVYKIS_CFLAGS="-I\${includedir}/syslog-ng/ivykis"
    820856
    821857                # LIBS to use when libtool is not applicable (when linking the main syslog-ng executable in mixed linking mode)
    822                 IVYKIS_NO_LIBTOOL_LIBS="-Wl,--whole-archive -L\$(top_builddir)/lib/ivykis/src/.libs -livykis -Wl,--no-whole-archive"
     858                IVYKIS_NO_LIBTOOL_LIBS="${LD_WHOLE_ARCHIVE} -L\$(top_builddir)/lib/ivykis/src/.libs -livykis ${LD_NO_WHOLE_ARCHIVE}"
    823859        else
    824860                AC_MSG_ERROR([Internal ivykis sources not found in lib/ivykis. This is a hard dependency, unable to build syslog-ng without them.])
    825861        fi
     
    11561192        SYSLOGNG_LINK='$(LINK)'
    11571193else
    11581194        SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $RESOLV_LIBS $LD_START_STATIC -Wl,--whole-archive $GLIB_LIBS $EVTLOG_LIBS $PCRE_LIBS $REGEX_LIBS -Wl,--no-whole-archive $IVYKIS_NO_LIBTOOL_LIBS $LD_END_STATIC $LIBCAP_LIBS $DL_LIBS "
     1195        SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $RESOLV_LIBS $LD_START_STATIC ${LD_WHOLE_ARCHIVE} $GLIB_LIBS $EVTLOG_LIBS $PCRE_LIBS $REGEX_LIBS ${LD_NO_WHOLE_ARCHIVE} $IVYKIS_NO_LIBTOOL_LIBS $LD_END_STATIC $LIBCAP_LIBS $DL_LIBS "
    11591196        TOOL_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $IVYKIS_LIBS $DL_LIBS"
    11601197        CORE_DEPS_LIBS=""
    11611198