-stupid svn didnt noticed old libntfs has less files

This commit is contained in:
fix94.1 2012-04-29 09:05:43 +00:00
parent 70e3df6d5d
commit bd15f4711d
3 changed files with 0 additions and 257 deletions

View File

@ -1,130 +0,0 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif
ifeq ($(PLATFORM),wii)
include $(DEVKITPPC)/wii_rules
endif
ifeq ($(PLATFORM),cube)
include $(DEVKITPPC)/gamecube_rules
endif
#---------------------------------------------------------------------------------
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
BUILD ?= wii_release
SOURCES := .
INCLUDES := ../include
LIBDIR := ../lib
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -O2 -Wall -ffast-math -pipe $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H
CXXFLAGS = $(CFLAGS)
ASFLAGS := -g
export NTFSBIN := $(LIBDIR)/$(PLATFORM)/libntfs.a
ifeq ($(BUILD),cube_debug)
CFLAGS += -DDEBUG
CXXFLAGS += -DDEBUG
endif
ifeq ($(BUILD),wii_debug)
CFLAGS += -DDEBUG
CXXFLAGS += -DDEBUG
endif
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS :=
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS :=
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export DEPSDIR := $(CURDIR)/$(BUILD)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(LIBOGC_LIB)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr wii_debug wii_release cube_debug cube_release $(LIBDIR)
all: $(NTFSBIN)
install:
cp ../include/ntfs.h $(DEVKITPRO)/libogc/include
cp ../lib/wii/libntfs.a $(DEVKITPRO)/libogc/lib/wii
cp ../lib/cube/libntfs.a $(DEVKITPRO)/libogc/lib/cube
wii-install:
cp ../include/ntfs.h $(DEVKITPRO)/libogc/include
cp ../lib/wii/libntfs.a $(DEVKITPRO)/libogc/lib/wii
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(NTFSBIN): $(OFILES) $(LIBDIR)/$(PLATFORM)
@rm -f "../$(NTFSBIN)"
@$(AR) rcs "../$(NTFSBIN)" $(OFILES)
@echo built ... $(notdir $@)
$(LIBDIR)/$(PLATFORM):
mkdir -p ../$(LIBDIR)/$(PLATFORM)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

View File

@ -1,103 +0,0 @@
/*
* realpath.c - realpath() aware of device mapper
* Originated from the util-linux project.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include "param.h"
#include "realpath.h"
/* If there is no realpath() on the system, provide a dummy one. */
#ifndef HAVE_REALPATH
char *ntfs_realpath(const char *path, char *resolved_path)
{
strncpy(resolved_path, path, PATH_MAX);
resolved_path[PATH_MAX] = '\0';
return resolved_path;
}
#endif
#ifdef linux
/*
* Converts private "dm-N" names to "/dev/mapper/<name>"
*
* Since 2.6.29 (patch 784aae735d9b0bba3f8b9faef4c8b30df3bf0128) kernel sysfs
* provides the real DM device names in /sys/block/<ptname>/dm/name
*/
static char *
canonicalize_dm_name(const char *ptname, char *canonical)
{
FILE *f;
size_t sz;
char path[MAPPERNAMELTH + 24];
char name[MAPPERNAMELTH + 16];
char *res = NULL;
snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptname);
if (!(f = fopen(path, "r")))
return NULL;
/* read "<name>\n" from sysfs */
if (fgets(name, sizeof(name), f) && (sz = strlen(name)) > 1) {
name[sz - 1] = '\0';
snprintf(path, sizeof(path), "/dev/mapper/%s", name);
res = strcpy(canonical, path);
}
fclose(f);
return res;
}
/*
* Canonicalize a device path
*
* Workaround from "basinilya" for fixing device mapper paths.
*
* Background (Phillip Susi, 2011-04-09)
* - ntfs-3g canonicalizes the device name so that if you mount with
* /dev/mapper/foo, the device name listed in mtab is /dev/dm-n,
* so you can not umount /dev/mapper/foo
* - umount won't even recognize and translate /dev/dm-n to the mount
* point, apparently because of the '-' involved. Editing mtab and
* removing the '-' allows you to umount /dev/dmn successfully.
*
* This code restores the devmapper name after canonicalization,
* until a proper fix is implemented.
*/
char *ntfs_realpath_canonicalize(const char *path, char *canonical)
{
char *p;
if (path == NULL)
return NULL;
if (!ntfs_realpath(path, canonical))
return NULL;
p = strrchr(canonical, '/');
if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
p = canonicalize_dm_name(p+1, canonical);
if (p)
return p;
}
return canonical;
}
#endif

View File

@ -1,24 +0,0 @@
/*
* realpath.h - realpath() aware of device mapper
*/
#ifndef REALPATH_H
#define REALPATH_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_REALPATH
#define ntfs_realpath realpath
#else
extern char *ntfs_realpath(const char *path, char *resolved_path);
#endif
#ifdef linux
extern char *ntfs_realpath_canonicalize(const char *path, char *resolved_path);
#else
#define ntfs_realpath_canonicalize ntfs_realpath
#endif
#endif /* REALPATH_H */