summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorEthan Vrhel <ethanvrhel@gmail.com>2021-11-15 19:12:06 -0800
committerEthan Vrhel <ethanvrhel@gmail.com>2021-11-15 19:13:25 -0800
commit7d7d3b52e4527cdaad47ad12644f955aeabd095c (patch)
tree97050c395581bbeccd6bbdc9d47421179148a8c2 /demos
parentb2ee478b1dac1e1684fbfea594cfa8fa6ba59e62 (diff)
downloadghostpdl-7d7d3b52e4527cdaad47ad12644f955aeabd095c.tar.gz
Updated READMEs and added install scripts
Diffstat (limited to 'demos')
-rw-r--r--demos/java/gsviewer/README.txt10
-rw-r--r--demos/java/mtdemo/README.txt50
-rw-r--r--demos/java/mtdemo/build_darwin.sh12
-rw-r--r--demos/java/mtdemo/build_linux.sh12
-rw-r--r--demos/java/mtdemo/build_win32.bat12
-rw-r--r--demos/java/mtdemo/install_darwin.sh11
-rw-r--r--demos/java/mtdemo/install_linux.sh7
7 files changed, 91 insertions, 23 deletions
diff --git a/demos/java/gsviewer/README.txt b/demos/java/gsviewer/README.txt
index 2808fed99..1b4776fef 100644
--- a/demos/java/gsviewer/README.txt
+++ b/demos/java/gsviewer/README.txt
@@ -48,10 +48,10 @@ Building:
-= WINDOWS =-
-Ensure both gs_jni.dll and gpdldll64.dll. Then, run the build_win32.bat script.
-This will automatically build and copy gsjava.jar to this directory. To run,
-open gsviewer.jar either through File Explorer or in the command line through
-the following command:
+Ensure both gs_jni.dll and gpdldll64.dll are built. Then, run the
+build_win32.bat script. This will automatically build and copy gsjava.jar to
+this directory. To run, open gsviewer.jar either through File Explorer or in
+the command line through the following command:
java -jar gsviewer.jar
@@ -67,4 +67,4 @@ directories. gsviewer.jar will be outputted in this directory.
Ensure Ghostscript has been built.
Run the build_darwin.sh script. This will automatically build
gs_jni.dylib, gsjava.jar, and copy the files to the needed
-directories. gsviewer.jar will be outputed in this directory.
+directories. gsviewer.jar will be outputed in this directory. \ No newline at end of file
diff --git a/demos/java/mtdemo/README.txt b/demos/java/mtdemo/README.txt
index f9c5f80e5..a08240917 100644
--- a/demos/java/mtdemo/README.txt
+++ b/demos/java/mtdemo/README.txt
@@ -7,29 +7,49 @@ What is here?
* Main.java - Class containing Java main method
* Worker.java - Class which handles concurrently running Ghostscript
-* build_win32.bat - Builds the Java program for Windows
+* build_darwin.sh - Builds the Java program on Darwin systems
+* build_linux.sh - Builds the Java program on Linux systems
+* build_win32.bat - Builds the Java program on Windows
+* install_linux.sh - Installs required libraries to run the demo on Linux
+* install_darwin.sh - Installs required libraries to run the demo on Darwin
* runmtd_win32.bat - Starts the Java program for Windows
+Build/run instructions:
-Building:
+-= WINDOWS =-
-Windows:
+1. Ensure the following libraries have been built and are in
+ this directory:
+ * gpdldll64.dll
+ * gs_jni.dll
-* Ensure the gsjava project has been built (..\gsjava\build_win32.bat)
-* Run build_win32.bat
+2. Run build_win32.bat to build.
+3. Run runmtd_win32.bat to start the application.
-Running:
-Windows:
+-= LINUX =-
-Needed in this directory to run:
+1. Ensure the following libraries have been built and are in
+ this directory:
+ * libgpdl.so (this would have been built as a link to another file, so
+ it should be copied into this directory and renamed to libgpdl.so)
+ gs_jni.so
-* gpdldll64.dll (COMPILED FOR MULTITHREADING - in psi\msvc.mak, near line 865, change "XCFLAGS=" to "XCFLAGS=/DGS_THREADSAFE")
-* gs_jni.dll (COMPILED FOR MULTITHREADING - enable GSJNI_SUPPORT_MT in settings.h)
-* gsjava.jar
+2. If using OpenJDK 8, the property "assistive_technologies" may
+ need to be modified for the Java code to build. It can be modified by
+ editing the "accessibility.properties" file. This is located at:
-The application can be started through the command line through the
-batch file "runmtd_win32.bat". The batch file takes an optional command
-line argument specifying the number of threads to be created. If
-specified, it should be an integer greater than 0. \ No newline at end of file
+ /etc/java-8-openjdk/accessibility.properties
+
+3. Run build_linux.sh to build.
+
+4. Run install_linux.sh to install required libraries.
+
+5. Run runmtd_linux.sh to start the application.
+
+
+-= DARWIN =-
+
+Same as Linux, except with .dylib extensions on all shared objects and
+"_darwin.sh" suffixes instead of "_linux.sh". \ No newline at end of file
diff --git a/demos/java/mtdemo/build_darwin.sh b/demos/java/mtdemo/build_darwin.sh
index 5688adfcb..985488dcf 100644
--- a/demos/java/mtdemo/build_darwin.sh
+++ b/demos/java/mtdemo/build_darwin.sh
@@ -1,5 +1,15 @@
#!/bin/bash
-echo "Build..."
+echo "Build mtdemo"
+
+cd ../gsjava
+
+bash build_darwin.sh
+
+cs ../mtdemo
+
+cp ../gsjava/gsjava.jar gsjava.jar
+
+echo "Compiling Java source..."
javac -classpath "../gsjava/bin;." "Main.java" "Worker.java"
echo "Done." \ No newline at end of file
diff --git a/demos/java/mtdemo/build_linux.sh b/demos/java/mtdemo/build_linux.sh
index 5688adfcb..e688a180d 100644
--- a/demos/java/mtdemo/build_linux.sh
+++ b/demos/java/mtdemo/build_linux.sh
@@ -1,5 +1,15 @@
#!/bin/bash
-echo "Build..."
+echo "Build mtdemo"
+
+cd ../gsjava
+
+bash build_linux.sh
+
+cs ../mtdemo
+
+cp ../gsjava/gsjava.jar gsjava.jar
+
+echo "Compiling Java source..."
javac -classpath "../gsjava/bin;." "Main.java" "Worker.java"
echo "Done." \ No newline at end of file
diff --git a/demos/java/mtdemo/build_win32.bat b/demos/java/mtdemo/build_win32.bat
index 5dd5f34b8..e77b63019 100644
--- a/demos/java/mtdemo/build_win32.bat
+++ b/demos/java/mtdemo/build_win32.bat
@@ -1,5 +1,15 @@
@echo off
-echo Build...
+echo Build mtdemo
+
+cd "..\gsjava"
+
+call build_win32
+
+cd "..\mtdemo"
+
+copy "..\gsjava\gsjava.jar" ".\gsjava.jar"
+
+echo Compiling Java source...
javac -cp ../gsjava/bin;. Main.java Worker.java
echo Done. \ No newline at end of file
diff --git a/demos/java/mtdemo/install_darwin.sh b/demos/java/mtdemo/install_darwin.sh
new file mode 100644
index 000000000..a1d900266
--- /dev/null
+++ b/demos/java/mtdemo/install_darwin.sh
@@ -0,0 +1,11 @@
+#!bin/bash
+
+echo "Copy gs_jni.dylib"
+cp "../jni/gs_jni/gs_jni.dylib" "gs_jni.dylib"
+
+cd ../../../sobin
+
+echo "Copy libgpdl.dylib"
+cp $(readlinkk "libgpdl.dylib") "../demos/java/gsviewer"
+
+cd ../demos/java/gsviewer \ No newline at end of file
diff --git a/demos/java/mtdemo/install_linux.sh b/demos/java/mtdemo/install_linux.sh
new file mode 100644
index 000000000..4772d70a6
--- /dev/null
+++ b/demos/java/mtdemo/install_linux.sh
@@ -0,0 +1,7 @@
+#!bin/bash
+
+cd ../jni/gs_jni
+
+bash install_linux.sh
+
+cd ../../gsviewer \ No newline at end of file