diff options
-rw-r--r-- | Makefile.am | 23 | ||||
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | SConstruct | 128 | ||||
-rw-r--r-- | configure.ac | 44 | ||||
-rw-r--r-- | dump/Makefile.am | 26 | ||||
-rw-r--r-- | fsck/Makefile.am | 26 | ||||
-rw-r--r-- | fuse/Makefile.am | 27 | ||||
-rw-r--r-- | label/Makefile.am | 26 | ||||
-rw-r--r-- | libexfat/Makefile.am | 39 | ||||
-rw-r--r-- | mkfs/Makefile.am | 41 |
10 files changed, 260 insertions, 131 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d3a659c --- /dev/null +++ b/Makefile.am @@ -0,0 +1,23 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2010-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +SUBDIRS = libexfat dump fsck fuse label mkfs @@ -16,22 +16,27 @@ Most GNU/Linux distributions already have fuse-exfat and exfat-utils in their re To build this project under GNU/Linux you need to install the following packages: * git -* scons +* autoconf +* automake +* pkg-config * fuse-devel (or libfuse-dev) * gcc +* make Get the source code, change directory and compile: ``` git clone https://github.com/relan/exfat.git cd exfat -scons +autoreconf --install +./configure --prefix=/usr +make ``` Then install driver and utilities: ``` -sudo scons install +sudo make install ``` # Mounting diff --git a/SConstruct b/SConstruct deleted file mode 100644 index d9bca0a..0000000 --- a/SConstruct +++ /dev/null @@ -1,128 +0,0 @@ -# -# SConstruct (10.09.09) -# SConscript for all components. -# -# Free exFAT implementation. -# Copyright (C) 2010-2015 Andrew Nayenko -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - -import os -import platform -import SCons - -env = Environment(**ARGUMENTS) -for var in ['PATH', 'SYSROOT']: - if var in os.environ: - env['ENV'][var] = os.environ[var] - -destdir = env.get('DESTDIR', '/sbin'); -libs = ['exfat'] -libfuse = 'fuse' - -if not env.GetOption('clean'): - conf = Configure(env) - - if 'AR' in os.environ: - conf.env.Replace(AR = os.environ['AR']) - if 'RANLIB' in os.environ: - conf.env.Replace(RANLIB = os.environ['RANLIB']) - if 'CC' in os.environ: - conf.env.Replace(CC = os.environ['CC']) - if 'CCFLAGS' in os.environ: - conf.env.Replace(CCFLAGS = os.environ['CCFLAGS']) - # Set default CCFLAGS for known compilers - if not conf.env['CCFLAGS']: - if conf.env['CC'] == 'gcc': - conf.env.Replace(CCFLAGS = '-Wall -O2 -ggdb -std=c99') - elif conf.env['CC'] == 'clang': - conf.env.Replace(CCFLAGS = '-Wall -O2 -g -std=c99') - if 'CPPFLAGS' in os.environ: - conf.env.Replace(CPPFLAGS = os.environ['CPPFLAGS']) - conf.env.Append(CPPDEFINES = {'_FILE_OFFSET_BITS' : 64}) - conf.env.Append(CPPPATH = ['libexfat']) - if 'LDFLAGS' in os.environ: - conf.env.Append(LINKFLAGS = os.environ['LDFLAGS']) - conf.env.Append(LIBPATH = ['libexfat']) - - # GNU/Linux requires _BSD_SOURCE define for vsyslog(), _XOPEN_SOURCE >= 500 - # for pread(), pwrite(), snprintf(), strdup(), etc. Everything needed is - # enabled by _GNU_SOURCE. - if platform.system() == 'Linux': - conf.env.Append(CPPDEFINES = '_GNU_SOURCE'); - - # Use 64-bit inode numbers (introduced in Mac OS X 10.5 Leopard). Require - # OSXFUSE (http://osxfuse.github.com). - if platform.system() == 'Darwin': - conf.env.Append(CPPDEFINES = '_DARWIN_USE_64_BIT_INODE') - conf.env.Append(CPPDEFINES = {'__DARWIN_UNIX03' : 1}) - conf.env.Append(CPPPATH = ['/usr/local/include/osxfuse']) - conf.env.Append(CFLAGS = '-mmacosx-version-min=10.5') - conf.env.Append(LINKFLAGS = '-mmacosx-version-min=10.5') - conf.env.Append(LIBPATH = ['/usr/local/lib']) - libfuse = 'osxfuse_i64' - - # FreeBSD does not support block devices, only raw devices. Ublio is - # required for unaligned I/O and caching. - if platform.system() == 'FreeBSD': - conf.env.Append(CPPDEFINES = 'USE_UBLIO') - libs.append('ublio') - conf.env.Append(CPPPATH = ['/usr/local/include']) - conf.env.Append(LIBPATH = ['/usr/local/lib']) - - if not conf.CheckCC(): - print ''' - A working C compiler is needed very much. -''' - Exit(1) - - env = conf.Finish() - - - -def make_symlink(dir, target, link_name): - workdir = os.getcwd() - os.chdir(dir) - try: - os.remove(link_name) - except OSError: - pass - os.symlink(target, link_name) - os.chdir(workdir) - -symlink = SCons.Action.ActionFactory(make_symlink, - lambda dir, target, link_name: - 'make_symlink("%s", "%s", "%s")' % (dir, target, link_name)) - -def program(pattern, output, alias, libs): - sources = Glob(pattern) - if not sources: - return - target = env.Program(output, sources, LIBS = libs) - if alias: - Clean(Alias('install', Install(destdir, target), - symlink(destdir, os.path.basename(output), alias)), - destdir + '/' + alias) - else: - Alias('install', Install(destdir, target)) - -env.Library('libexfat/exfat', Glob('libexfat/*.c')) - -program('fuse/*.c', 'fuse/mount.exfat-fuse', 'mount.exfat', [libs + [libfuse]]) -program('dump/*.c', 'dump/dumpexfat', None, libs) -program('fsck/*.c', 'fsck/exfatfsck', 'fsck.exfat', libs) -program('mkfs/*.c', 'mkfs/mkexfatfs', 'mkfs.exfat', libs) -program('label/*.c', 'label/exfatlabel', None, libs) diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..145169a --- /dev/null +++ b/configure.ac @@ -0,0 +1,44 @@ +# +# configure.ac (30.03.15) +# Autoconf source. +# +# Free exFAT implementation. +# Copyright (C) 2010-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +AC_INIT([Free exFAT implementation], + [1.2.0], + [relan@users.noreply.github.com], + [exfat], + [https://github.com/relan/exfat]) +AM_INIT_AUTOMAKE([1.11.2 -Wall -Werror foreign subdir-objects]) +AC_PROG_CC +AC_PROG_CC_C99 +AC_PROG_RANLIB +AM_PROG_AR +AC_SYS_LARGEFILE +PKG_CHECK_MODULES([FUSE], [fuse]) +AC_CONFIG_HEADERS([libexfat/config.h]) +AC_CONFIG_FILES([ + libexfat/Makefile + dump/Makefile + fsck/Makefile + fuse/Makefile + label/Makefile + mkfs/Makefile + Makefile]) +AC_OUTPUT diff --git a/dump/Makefile.am b/dump/Makefile.am new file mode 100644 index 0000000..dd68665 --- /dev/null +++ b/dump/Makefile.am @@ -0,0 +1,26 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2011-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +sbin_PROGRAMS = dumpexfat +dumpexfat_SOURCES = main.c +dumpexfat_CPPFLAGS = -I$(top_srcdir)/libexfat +dumpexfat_LDADD = ../libexfat/libexfat.a diff --git a/fsck/Makefile.am b/fsck/Makefile.am new file mode 100644 index 0000000..b98a6e0 --- /dev/null +++ b/fsck/Makefile.am @@ -0,0 +1,26 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2011-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +sbin_PROGRAMS = exfatfsck +exfatfsck_SOURCES = main.c +exfatfsck_CPPFLAGS = -I$(top_srcdir)/libexfat +exfatfsck_LDADD = ../libexfat/libexfat.a diff --git a/fuse/Makefile.am b/fuse/Makefile.am new file mode 100644 index 0000000..4d1debf --- /dev/null +++ b/fuse/Makefile.am @@ -0,0 +1,27 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2010-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +sbin_PROGRAMS = mount.exfat-fuse +mount_exfat_fuse_SOURCES = main.c +mount_exfat_fuse_CPPFLAGS = -I$(top_srcdir)/libexfat +mount_exfat_fuse_CFLAGS = $(FUSE_CFLAGS) +mount_exfat_fuse_LDADD = ../libexfat/libexfat.a $(FUSE_LIBS) diff --git a/label/Makefile.am b/label/Makefile.am new file mode 100644 index 0000000..ac27a5a --- /dev/null +++ b/label/Makefile.am @@ -0,0 +1,26 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2011-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +sbin_PROGRAMS = exfatlabel +exfatlabel_SOURCES = main.c +exfatlabel_CPPFLAGS = -I$(top_srcdir)/libexfat +exfatlabel_LDADD = ../libexfat/libexfat.a diff --git a/libexfat/Makefile.am b/libexfat/Makefile.am new file mode 100644 index 0000000..f59fa34 --- /dev/null +++ b/libexfat/Makefile.am @@ -0,0 +1,39 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2010-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +noinst_LIBRARIES = libexfat.a +libexfat_a_SOURCES = \ + byteorder.h \ + cluster.c \ + compiler.h \ + exfat.h \ + exfatfs.h \ + io.c \ + log.c \ + lookup.c \ + mount.c \ + node.c \ + platform.h \ + time.c \ + utf.c \ + utils.c \ + version.h diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am new file mode 100644 index 0000000..d1af1f1 --- /dev/null +++ b/mkfs/Makefile.am @@ -0,0 +1,41 @@ +# +# Makefile.am (30.03.15) +# Automake source. +# +# Free exFAT implementation. +# Copyright (C) 2011-2015 Andrew Nayenko +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +sbin_PROGRAMS = mkexfatfs +mkexfatfs_SOURCES = \ + cbm.c \ + cbm.h \ + fat.c \ + fat.h \ + main.c \ + mkexfat.c \ + mkexfat.h \ + rootdir.c \ + rootdir.h \ + uct.c \ + uct.h \ + uctc.c \ + uctc.h \ + vbr.c \ + vbr.h +mkexfatfs_CPPFLAGS = -I$(top_srcdir)/libexfat +mkexfatfs_LDADD = ../libexfat/libexfat.a |