Added configure parameter --enable-mclib for build own shared library

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-03-04 18:07:30 +02:00
parent c0637dcb27
commit 06f99484de
3 changed files with 47 additions and 12 deletions

View File

@ -11,6 +11,11 @@ AC_CONFIG_AUX_DIR(config)
MC_VERSION
AM_INIT_AUTOMAKE(mc, ${VERSION} )
LIBMC_VERSION="0.0.1"
LIBMC_RELEASE="1"
AC_SUBST(LIBMC_VERSION)
AC_SUBST(LIBMC_RELEASE)
dnl Enable silent rules by default (if yes)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@ -45,6 +50,24 @@ dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
AC_CHECK_GLIB
AC_ARG_ENABLE([mclib],
[AS_HELP_STRING([--enable-mclib],[ Compile shared library libmc.so [no]])],
[
if test "x$enableval" = "xno" ; then
enable_mclib=no
else
if test "x$enable_shared" = "xno" ; then
AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
enable_mclib=no
else
enable_mclib=yes
fi
fi
],
[enable_mclib=no])
AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
AC_HEADER_MAJOR
AC_C_CONST
AC_SYS_LARGEFILE

View File

@ -1,6 +1,17 @@
SUBDIRS = event filehighlight mcconfig search skin tty vfs strutil widget
noinst_LTLIBRARIES = libmc.la
if ENABLE_MCLIB
LIB_VERSION=`echo $(LIBMC_VERSION) | \
tr '.' ' '| \
while read v1 v2 v3; do echo $$v2':'$$v3':'$$v1; done`
libmc_la_LDFLAGS=-no-undefined -version-info $(LIB_VERSION) -release $(LIBMC_RELEASE)
lib_LTLIBRARIES = libmc.la
else
noinst_LTLIBRARIES = libmc.la
endif
SUBLIB_includes = \
event.h event-types.h \
@ -50,3 +61,14 @@ libmc_la_LIBADD = \
tty/libmctty.la \
vfs/libmcvfs.la \
widget/libmcwidget.la
libmc_la_LIBADD += $(MCLIBS) $(SLANGLIB)
if HAVE_GMODULE
libmc_la_LIBADD += $(GMODULE_LIBS)
else
libmc_la_LIBADD += $(GLIB_LIBS)
endif
libmc_la_LIBADD += $(PCRE_LIBS) $(LIBICONV) $(INTLLIBS)

View File

@ -35,23 +35,13 @@ mc_LDADD = \
viewer/libmcviewer.la \
filemanager/libmcfilemanager.la \
$(DIFFLIB) $(EDITLIB) \
../lib/libmc.la
$(top_builddir)/lib/libmc.la
if ENABLE_VFS_SMB
# this is a hack for linking with own samba library in simple way
mc_LDADD += vfs/smbfs/helpers/libsamba.a
endif
mc_LDADD += $(MCLIBS) $(SLANGLIB)
if HAVE_GMODULE
mc_LDADD += $(GMODULE_LIBS)
else
mc_LDADD += $(GLIB_LIBS)
endif
mc_LDADD += $(PCRE_LIBS) $(LIBICONV) $(INTLLIBS)
SRC_mc_conssaver = \
cons.handler.c consaver/cons.saver.h