Skip to content

Commit

Permalink
Add modland.com support using a local copy of the file-list provided …
Browse files Browse the repository at this point in the history
…by modland.com.
  • Loading branch information
mywave82 committed Dec 14, 2024
1 parent 9410a85 commit 9f0d0c5
Show file tree
Hide file tree
Showing 19 changed files with 3,944 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include cpiface/Makefile-static
include devp/Makefile-static
include filesel/Makefile-static
include filesel/cdfs/Makefile-static
include filesel/modland.com/Makefile-static
include stuff/Makefile-static
include dev/Makefile-static
include help/Makefile-static
Expand Down
31 changes: 25 additions & 6 deletions boot/pmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,17 +1010,36 @@ static int init_modules(int argc, char *argv[])
cfSetProfileInt ("fscolors", "UNKN", 7, 10);
}

if (epoch < 20240211)
if (epoch < 20240510)
{
fprintf (stderr, "ocp.ini update (0.2.110) add [modland.com] mirror=https://ftp.modland.com\n");
#ifdef _WIN32
fprintf (stderr, "ocp.ini update (0.2.110) add [modland.com] cachedir=$OCPDATAHOME\\modland.com\\\n");
#else
fprintf (stderr, "ocp.ini update (0.2.110) add [modland.com] cachedir=$OCPDATAHOME/modland.com/\n");
#endif
fprintf (stderr, "ocp.ini update (0.2.110) add [modland.com] showrelevantdirectoriesonly=1\n");

cfSetProfileString ("modland.com", "mirror", "https://ftp.modland.com");
#ifdef _WIN32
cfSetProfileString ("modland.com", "cachedir", "$OCPDATAHOME\\modland.com\\");
#else
cfSetProfileString ("modland.com", "cachedir", "$OCPDATAHOME/modland.com/");
#endif
cfSetProfileBool ("modland.com", "showrelevantdirectoriesonly", 1);
}

if (epoch < 20240510)
{
fprintf(stderr, "ocp.ini update (0.2.107) add [libsidplayfp] filterrange6581=0.5\n");
cfSetProfileString ("libsidplayfp", "filterrange6581", "0.5");
fprintf(stderr, "ocp.ini update (0.2.107) add [libsidplayfp] combinedwaveforms=Average\n");
cfSetProfileString ("libsidplayfp", "combinedwaveforms", "Average");
}

if (epoch < 20240211)
if (epoch < 20240510)
{
cfSetProfileInt("version", "epoch", 20240211, 10);
cfSetProfileInt("version", "epoch", 20240510, 10);
cfStoreConfig();
if (isatty(2))
{
Expand All @@ -1031,14 +1050,14 @@ static int init_modules(int argc, char *argv[])
sleep(5);
}
}
if (cfGetProfileInt("version", "epoch", 0, 10) != 20240211)
if (cfGetProfileInt("version", "epoch", 0, 10) != 20240510)
{
if (isatty(2))
{
fprintf(stderr,"\n\033[1m\033[31mWARNING, ocp.ini [version] epoch != 20240211\033[0m\n\n");
fprintf(stderr,"\n\033[1m\033[31mWARNING, ocp.ini [version] epoch != 20240510\033[0m\n\n");
sleep(5);
} else {
fprintf(stderr,"\nWARNING, ocp.ini [version] epoch != 20240211\n\n");
fprintf(stderr,"\nWARNING, ocp.ini [version] epoch != 20240510\n\n");
}
}

Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ PTHREAD_LIBS
EXE_SUFFIX
LIB_SUFFIX
SHARED_FLAGS
DIRSEPARATOR
UPDATE_DESKTOP_DATABASE
DESKTOP_FILE_INSTALL
UPDATE_MIME_DATABASE
Expand Down Expand Up @@ -7756,6 +7757,7 @@ printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h



DIRSEPARATOR="/"
target=`$CC -dumpmachine`
case $target in #(
*-darwin*) :
Expand All @@ -7778,6 +7780,7 @@ case $target in #(
*-mingw*) :

WINDOWS=1
DIRSEPARATOR=\\
SHARED_FLAGS="-shared -pthread" # clock_gettime() is provided via -pthread when using mingw
LIB_SUFFIX=.dll
EXE_SUFFIX=.exe
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ AC_SUBST(DESKTOP_FILE_INSTALL)
AC_SUBST(UPDATE_DESKTOP_DATABASE)

AC_C_BIGENDIAN

AC_SUBST(DIRSEPARATOR)
AC_SUBST(SHARED_FLAGS)
AC_SUBST(LIB_SUFFIX)
AC_SUBST(EXE_SUFFIX)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(HAIKU)
AC_SUBST(WINDOWS)
AC_SUBST(WINDRES)
DIRSEPARATOR="/"
target=`$CC -dumpmachine`
AS_CASE([$target],
[*-darwin*],[
Expand All @@ -78,6 +79,7 @@ AS_CASE([$target],
],
[*-mingw*],[
WINDOWS=1
DIRSEPARATOR=\\
SHARED_FLAGS="-shared -pthread" # clock_gettime() is provided via -pthread when using mingw
LIB_SUFFIX=.dll
EXE_SUFFIX=.exe
Expand Down
4 changes: 4 additions & 0 deletions filesel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ else
all: $(CDROM_SO) pfilesel$(LIB_SUFFIX)
endif
$(MAKE) -C cdfs TOPDIR=../$(TOPDIR)
$(MAKE) -C modland.com TOPDIR=../$(TOPDIR)

test: adbmeta-test$(EXE_SUFFIX) dirdb-test$(EXE_SUFFIX) filesystem-bzip2-test$(EXE_SUFFIX) filesystem-filehandle-cache-test$(EXE_SUFFIX) filesystem-gzip-test$(EXE_SUFFIX) filesystem-tar-test$(EXE_SUFFIX) filesystem-textfile-test$(EXE_SUFFIX) mdb-test$(EXE_SUFFIX)
@echo "" && echo "adbmeta-test:" && ./adbmeta-test
Expand All @@ -27,6 +28,7 @@ pfilesel$(LIB_SUFFIX): $(pfilesel_so)

clean:
$(MAKE) -C cdfs TOPDIR=../$(TOPDIR) clean
$(MAKE) -C modland.com TOPDIR=../$(TOPDIR) clean
rm -f *.o *$(LIB_SUFFIX) adbmeta-test$(EXE_SUFFIX) dirdb-test$(EXE_SUFFIX) filesystem-bzip2-test$(EXE_SUFFIX) filesystem-filehandle-cache-test$(EXE_SUFFIX) filesystem-gzip-test$(EXE_SUFFIX) filesystem-tar-test$(EXE_SUFFIX) filesystem-textfile-test$(EXE_SUFFIX) mdb-test$(EXE_SUFFIX)

ifeq ($(STATIC_CORE),1)
Expand All @@ -39,10 +41,12 @@ ifeq ($(CDROM_SUPPORT),1)
$(CP) $(CDROM_SO) "$(DESTDIR)$(LIBDIROCP)/autoload/30-cdrom$(LIB_SUFFIX)"
endif
$(MAKE) -C cdfs TOPDIR=../$(TOPDIR) install
$(MAKE) -C modland.com TOPDIR=../$(TOPDIR) install
uninstall:
rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/25-pfilesel$(LIB_SUFFIX)"
rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/30-cdrom$(LIB_SUFFIX)"
$(MAKE) -C cdfs TOPDIR=../$(TOPDIR) uninstall
$(MAKE) -C modland.com TOPDIR=../$(TOPDIR) uninstall
endif

adbmeta.o: adbmeta.c adbmeta.h \
Expand Down
55 changes: 55 additions & 0 deletions filesel/modland.com/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
TOPDIR=../../
include $(TOPDIR)Rules.make
include Makefile-static

ifeq ($(STATIC_CORE),1)
all: $(modland_com_so)
else
all: modland_com$(LIB_SUFFIX)
endif

clean:
rm -f modland_com$(LIB_SUFFIX) *.o

ifeq ($(STATIC_CORE),1)
install:
uninstall:
else
install:
$(CP) modland_com$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/60-modland_com$(LIB_SUFFIX)"
uninstall:
rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/60-modland_com$(LIB_SUFFIX)"
endif

.PHONY: all clean install uninstall

modland_com$(LIB_SUFFIX): $(modland_com_so)
$(CC) $(SHARED_FLAGS) -o $@ $^

modland-com.o: \
modland-com.c \
modland-com-cachedir.c \
modland-com-dir.c \
modland-com-file.c \
modland-com-filedb.c \
modland-com-filehandle.c \
modland-com-initialize.c \
modland-com-mirrors.c \
modland-com-removecache.c \
modland-com-setup.c \
../download.h \
../../config.h \
../../types.h \
../../boot/plinkman.h \
../../boot/psetting.h \
../../filesel/dirdb.h \
../../filesel/filesystem.h \
../../filesel/filesystem-dir-mem.h \
../../filesel/filesystem-drive.h \
../../filesel/filesystem-file-dev.h \
../../filesel/filesystem-textfile.h \
../../stuff/err.h \
../../stuff/file.h \
../../stuff/framelock.h \
../../stuff/poutput.h
$(CC) $< -o $@ -c
5 changes: 5 additions & 0 deletions filesel/modland.com/Makefile-static
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
modland_com_so=modland-com.o

ifeq ($(STATIC_CORE),1)
STATIC_OBJECTS += $(patsubst %.o,filesel/modland.com/%.o,$(modland_com_so))
endif
Loading

0 comments on commit 9f0d0c5

Please sign in to comment.