diff --git a/.gitignore b/.gitignore index 0437957..ceb5085 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,16 @@ -build_pfs0* -elf2nso* +build* +INSTALL +Makefile.in +aclocal.m4 +autom4te.cache +config.guess +config.sub +configure +depcomp +install-sh +missing +compile +.deps +Makefile +config.status +config.log \ No newline at end of file diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..b4249b0 --- /dev/null +++ b/COPYING @@ -0,0 +1,5 @@ +Copyright 2017 libnx Authors + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile deleted file mode 100644 index 86cb0aa..0000000 --- a/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -all: elf2nso elf2nro build_pfs0 - -build_pfs0: build_pfs0.c - gcc $(CFLAGS) -o $@ $^ - -elf2nso: elf2nso.c sha256.c - gcc $(CFLAGS) -o $@ $^ -llz4 - -elf2nro: elf2nro.c - gcc $(CFLAGS) -o $@ $^ - -install: all - cp build_pfs0 $(DEVKITA64)/bin/ - cp elf2nso $(DEVKITA64)/bin/ - cp elf2nro $(DEVKITA64)/bin/ - -clean: - rm -f elf2nso elf2nro build_pfs0 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..053f26a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,10 @@ +# Makefile.am -- Process this file with automake to produce Makefile.in +bin_PROGRAMS = elf2nso elf2nro build_pfs0 + +build_pfs0_SOURCES = src/build_pfs0.c src/types.h +elf2nro_SOURCES = src/elf2nro.c src/elf64.h src/elf_common.h +elf2nso_SOURCES = src/elf2nso.c src/sha256.c src/sha256.h src/elf64.h src/elf_common.h + +elf2nso_LDADD = @LZ4_LIBS@ + +EXTRA_DIST = autogen.sh diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..9d9bcc6 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,3 @@ +aclocal +autoconf +automake --add-missing -c diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c229183 --- /dev/null +++ b/configure.ac @@ -0,0 +1,26 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT([switch-tools],[1.0.0],[https://github.com/switchbrew/switch-tools/issues]) +AC_CONFIG_SRCDIR([src/build_pfs0.c]) + +AM_INIT_AUTOMAKE([subdir-objects]) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AC_PROG_CC + + +PKG_CHECK_MODULES([LZ4], + [liblz4 >= 1.7.1 liblz4 < 100], + [have_lz4="yes"], + [LZ4_LIBS="-llz4"] # If this fails, we will do another test next. + # We also add set LZ4_LIBS otherwise the + # linker will not know about the lz4 library +) + +AC_SUBST(LZ4_LIBS) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/build_pfs0.c b/src/build_pfs0.c similarity index 100% rename from build_pfs0.c rename to src/build_pfs0.c diff --git a/elf2nro.c b/src/elf2nro.c similarity index 100% rename from elf2nro.c rename to src/elf2nro.c diff --git a/elf2nso.c b/src/elf2nso.c similarity index 100% rename from elf2nso.c rename to src/elf2nso.c diff --git a/elf64.h b/src/elf64.h similarity index 100% rename from elf64.h rename to src/elf64.h diff --git a/elf_common.h b/src/elf_common.h similarity index 100% rename from elf_common.h rename to src/elf_common.h diff --git a/sha256.c b/src/sha256.c similarity index 100% rename from sha256.c rename to src/sha256.c diff --git a/sha256.h b/src/sha256.h similarity index 100% rename from sha256.h rename to src/sha256.h diff --git a/types.h b/src/types.h similarity index 100% rename from types.h rename to src/types.h