On Thu, 23 Aug 2007, Szabolcs Szakacsits wrote:
AFAICS, In ntfs-3g, libntfs-3g is handled in the Makefiles like libntfs
was in ntfsprogs, but it is used by only one program, which is ntfs-3g
itself.
In the ntfs-3g package, yes. Otherwise it's also used with the ntfsprogs
tools (resource/maintenance split), with plently internal and external
utils, on platforms where FUSE is not available yet (e.g. DOS), etc.
In fact, we got a patch earlier to build/install libntfs-3g only and what
I didn't commit yet unfortunately :(
http://article.gmane.org/gmane.comp.file-systems.ntfs-3g.devel/48
Yes, looks like a nice way to go for. I have not followed the ntfsprogs
lists but I have seen that they are continuing some work there as well,
so I wonder if it wouln't be good to have those two branches merged
together.
As there is only one user of libntfs-3g, I wonder if it makes sense
to install libntfs-3g with ntfs-3g, or if it would make more sense
to just link libntfs-3g into ntfs-3g.
Currently it's possible to use --enable-really-static which makes a
completely static build. --enable-static doesn't work for some reason.
--enable-static does nothing because it already default because you have
AM_ENABLE_STATIC
in configure.ac before AC_PROG_LIBTOOL.
enable-static only means that a static library is built, not that it
is going to be used for building a program like ntfs-3g with it, because
you use
LIBTOOL_LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS)
$(LDFLAGS) -o $@
in Makefile.am when REALLYSTATIC is not defined and libtool defaults
to use shared libraries whenever they are available over static ones
because you'd otherwise get completley statically linked programs when
you have the static libraries insalled, negating the idea of shared
libraries to share the compiled code amongst many applications.
I have not investigated into other ways of doing that yet, but when
you simply do not have a shared library available when linking the
final ntfs-3g executable with the above LIBTOOL_LINK command, libtool
will only find the static libntfs-3g and links it into ntfs-3g then.
This is accomplished by calling configure with:
--disable-shared
You could make that even default by replacing the AM_ENABLE_SHARED
in configure.ac with AM_DISABLE_SHARED, which only changes the default
and confiure then shows the option to use --enable-shared in it's
--help output and the ntfs-3g application will be linked dynamically
as a result.
But I think it would make sense to support what you suggested optionally.
Embedded distros/vendors would love it, there are more in every day :)
Thanks!
Szaka
Understood. Here it comes (also attached).
As far as I could see, this patch changes not default whether and which
libraries are built by default, but adds the option which you suggest
./configure --help
[...]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-debug enable additional debugging code and output
--enable-really-static create static binaries for the utilities
--enable-warnings enable additional compiler warnings
--disable-ldconfig do not update dynamic linker cache using ldconfig
--disable-library do not install libntfs-3g but link it into ntfs-3g
[...]
An option name whould describe it possibly better would be
--disable-install-library,
but it would be also rather long and --disable-library effectively describes the
end result which you get after make install.
Here is what this version does (only when --disable-library is given):
* disables builing the shared libntfs-3g to force libtool to use the static
libntfs-3g for linking ntfs-3g
* prevents the static libntfs-3g an the libntfs-3g header files from getting
installed on make install
Note on the implementation:
I used "{en,dis}able-library" for the autoconf option processing but
for the second part of that it does (not to installing the library), it uses
the automake conditional INSTALL_LIBRARY in the Makefile.am files as it
describes this part of that it can change better.
Do not try to change $enable_library to e.g. $install_library, that would
not work as expected in the configure script, the variable has to start
with "enable_" and that has to be appended by "library" or you can't use
--{en,dis}able-library as the configure option. It's just how the magic
implemented by autoconf option processing works with AC_ARG_ENABLE, so
don't change it, you could end up with --enable-library actually disabling
library installation like I did before I got it right.
Bernhard
PS: Patch follows here and in attachment:
--- ntfs-3g-1.810/configure.ac
+++ ntfs-3g-1.810/configure.ac
@@ -78,6 +78,16 @@
)
AM_CONDITIONAL(RUN_LDCONFIG, test "$enable_ldconfig" = yes)
+AC_ARG_ENABLE(library,
+ AS_HELP_STRING(--disable-library,do not install libntfs-3g but link
+ it into ntfs-3g), ,
+ enable_library=yes
+)
+if test "$enable_library" != yes; then
+ enable_shared=no
+fi
+AM_CONDITIONAL(INSTALL_LIBRARY, test "$enable_library" = yes)
+
# Use GNU extensions if available.
AC_GNU_SOURCE
--- ntfs-3g-1.810/libntfs-3g/Makefile.am
+++ ntfs-3g-1.810/libntfs-3g/Makefile.am
@@ -27,7 +27,12 @@
linux_ntfsincludedir = -I$(top_srcdir)/include/ntfs-3g
+if INSTALL_LIBRARY
lib_LTLIBRARIES = libntfs-3g.la
+else
+noinst_LTLIBRARIES = libntfs-3g.la
+endif
+
libntfs_3g_la_LDFLAGS = -version-number $(LIBNTFS_3G_VERSION)
libntfs_3g_la_CFLAGS = $(LIBNTFS_3G_CFLAGS)
libntfs_3g_la_SOURCES = \
--- ntfs-3g-1.810/include/ntfs-3g/Makefile.am
+++ ntfs-3g-1.810/include/ntfs-3g/Makefile.am
@@ -1,4 +1,5 @@
+if INSTALL_LIBRARY
linux_ntfsincludedir = $(includedir)/ntfs-3g
linux_ntfsinclude_HEADERS = \
attrib.h \
@@ -30,5 +31,6 @@
unistr.h \
version.h \
volume.h
+endif
MAINTAINERCLEANFILES = Makefile.in--- ntfs-3g-1.810/configure.ac
+++ ntfs-3g-1.810/configure.ac
@@ -78,6 +78,16 @@
)
AM_CONDITIONAL(RUN_LDCONFIG, test "$enable_ldconfig" = yes)
+AC_ARG_ENABLE(library,
+ AS_HELP_STRING(--disable-library,do not install libntfs-3g but link
+ it into ntfs-3g), ,
+ enable_library=yes
+)
+if test "$enable_library" != yes; then
+ enable_shared=no
+fi
+AM_CONDITIONAL(INSTALL_LIBRARY, test "$enable_library" = yes)
+
# Use GNU extensions if available.
AC_GNU_SOURCE
--- ntfs-3g-1.810/libntfs-3g/Makefile.am
+++ ntfs-3g-1.810/libntfs-3g/Makefile.am
@@ -27,7 +27,12 @@
linux_ntfsincludedir = -I$(top_srcdir)/include/ntfs-3g
+if INSTALL_LIBRARY
lib_LTLIBRARIES = libntfs-3g.la
+else
+noinst_LTLIBRARIES = libntfs-3g.la
+endif
+
libntfs_3g_la_LDFLAGS = -version-number $(LIBNTFS_3G_VERSION)
libntfs_3g_la_CFLAGS = $(LIBNTFS_3G_CFLAGS)
libntfs_3g_la_SOURCES = \
--- ntfs-3g-1.810/include/ntfs-3g/Makefile.am
+++ ntfs-3g-1.810/include/ntfs-3g/Makefile.am
@@ -1,4 +1,5 @@
+if INSTALL_LIBRARY
linux_ntfsincludedir = $(includedir)/ntfs-3g
linux_ntfsinclude_HEADERS = \
attrib.h \
@@ -30,5 +31,6 @@
unistr.h \
version.h \
volume.h
+endif
MAINTAINERCLEANFILES = Makefile.in
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel