Hi, I'm trying to build enigmail-1.8.2 on OS/2. The problems are that OS/2 only
supports 8.3 naming with DLLs and needs a def file.
With this patch (ignore the changes to configure) the build dies here.
...
make[1]: Leaving directory `K:/usr/local/src/enigmail-1.8.2/lang'
./util/genxpi enigmail-1.8-os2-x86-gcc3.xpi 1.8 OS2 x86-gcc3 ./build/dist .
enigmail .dll yes
genxpi: Generating enigmail-1.8-os2-x86-gcc3.xpi in ./build/dist
Creating enigmail-1.8-os2-x86-gcc3.xpi file
zip warning: name not matched: subproc.dll
zip I/O error: No such file or directory
zip error: File not found or no read permission (subproc.dll)
make: *** [xpi] Error 18
...
>From 918f990fc70873b98ec9e0271ea30251869840d1 Mon Sep 17 00:00:00 2001
From: Dave Yeo <[email protected]>
Date: Sun, 4 Oct 2015 21:58:44 -0700
Subject: [PATCH] Compile on OS/2
OS/2 needs a def file and 8.3 naming to produce a working DLL
---
config/getOsTarget.pl | 3 +++
configure | 64 +++++++++++++++++++++++++++++++++++++++++++++-----
ipc/src/Makefile | 12 +++++++++-
ipc/src/subprocess.def | 8 +++++++
util/genxpi | 6 +++++
5 files changed, 86 insertions(+), 7 deletions(-)
create mode 100644 ipc/src/subprocess.def
diff --git a/config/getOsTarget.pl b/config/getOsTarget.pl
index d6205e9..9dfc717 100755
--- a/config/getOsTarget.pl
+++ b/config/getOsTarget.pl
@@ -138,6 +138,9 @@ elsif ($targetOs eq "Darwin") {
$dllPrefix = "lib";
$dllSuffix = ".dylib";
}
+elsif ($targetOs eq "OS2") {
+ $dllSuffix = ".dll";
+}
else {
$dllPrefix = "lib";
$dllSuffix = ".so";
diff --git a/configure b/configure
index d459eae..0cb4de6 100755
--- a/configure
+++ b/configure
@@ -74,8 +74,8 @@ fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ (PATH='/bin;/bin;/@unixroot/usr/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1
&& {
+ (PATH='/bin:/bin:/@unixroot/usr/bin'; FPATH=$PATH; sh -c :) >/dev/null
2>&1 ||
PATH_SEPARATOR=';'
}
fi
@@ -1109,7 +1109,7 @@ do
esac
# Be sure to have absolute directory names.
case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
+ [\\/$]* | ?:[\\/]* | ?: ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
@@ -1689,6 +1689,58 @@ See \`config.log' for more details" "$LINENO" 5; }
fi
done
+# Backslashes into forward slashes:
+# The following OS/2 specific code is performed AFTER config.site
+# has been loaded to allow users to change their environment there.
+# This strange code is necessary to deal with handling of backslashes by ksh.
+
+if test "$ac_emxsupport" != "no" -a "$ac_emxsupport" != "NO"; then
+ ac_save_IFS="$IFS"
+ IFS="\\"
+ ac_TEMP_PATH=
+ for ac_dir in $PATH; do
+ IFS=$ac_save_IFS
+ if test -z "$ac_TEMP_PATH"; then
+ ac_TEMP_PATH="$ac_dir"
+ else
+ ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
+ fi
+ done
+ export PATH="$ac_TEMP_PATH"
+ unset ac_TEMP_PATH
+
+ # Also, make sure that unix-like entries in PATH contain /@unixroot instead
of
+ # hardcoded absolute paths to avoid these hardcoded paths in generated files.
+ if test -n "$UNIXROOT"; then
+ ac_save_IFS="$IFS"
+ ac_TEMP_UNIXROOT=`echo "$UNIXROOT" | tr [:upper:] [:lower:]`
+ IFS="$PATH_SEPARATOR"
+ ac_TEMP_PATH=
+ for ac_dir in `echo "$PATH" | tr [:upper:] [:lower:]`; do
+ IFS=$ac_save_IFS
+ case "$ac_dir" in
+ $ac_TEMP_UNIXROOT/usr/*)
ac_dir="/@unixroot${ac_dir#$ac_TEMP_UNIXROOT}" ;;
+ esac
+ if test -z "$ac_TEMP_PATH"; then
+ ac_TEMP_PATH="$ac_dir"
+ else
+ ac_TEMP_PATH="$ac_TEMP_PATH$PATH_SEPARATOR$ac_dir"
+ fi
+ done
+ unset ac_TEMP_UNIXROOT
+ export PATH="$ac_TEMP_PATH"
+ unset ac_TEMP_PATH
+ fi
+fi
+
+# set ac_executable_extensions!
+if test "$ac_executable_extensions" = ""; then
+ if (sh -c : && sh.exe -c :) >/dev/null 2>/dev/null; then
+ ac_executable_extensions=".exe"
+ export ac_executable_extensions
+ fi
+fi
+
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
@@ -2533,7 +2585,7 @@ else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
- CFLAGS="-g"
+ CFLAGS="$CFLAGS -g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -3153,8 +3205,8 @@ fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ (PATH='/bin;/bin;/@unixroot/usr/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1
&& {
+ (PATH='/bin:/bin:/@unixroot/usr/bin'; FPATH=$PATH; sh -c :) >/dev/null
2>&1 ||
PATH_SEPARATOR=';'
}
fi
diff --git a/ipc/src/Makefile b/ipc/src/Makefile
index b1f0731..df30422 100644
--- a/ipc/src/Makefile
+++ b/ipc/src/Makefile
@@ -59,9 +59,19 @@ ifeq ($(OS_TARGET),WINNT)
OBJ_SUFF = obj
endif
+ifeq ($(OS_TARGET),OS2)
+LDFLAGS += -Zomf -Zdll
+endif
+
source = subprocess.c
objfiles = subprocess.$(OBJ_SUFF)
+deffile =
+ifneq ($(OS_TARGET),OS2)
libname = $(DLL_PREFIX)subprocess-$(CPU_ARCH)$(DLL_SUFFIX)
+else
+libname = subproc$(DLL_SUFFIX)
+deffile = subprocess.def
+endif
all: install
@@ -69,7 +79,7 @@ all: install
$(objfiles): $(source)
$(CC) $(CFLAGS) -Wno-return-type-c-linkage -c -o $(objfiles) $^
-$(libname): $(objfiles)
+$(libname): $(objfiles) $(deffile)
$(CC) $(LDFLAGS) -o $(libname) $(objfiles)
install: $(libname)
diff --git a/ipc/src/subprocess.def b/ipc/src/subprocess.def
new file mode 100644
index 0000000..866143a
--- /dev/null
+++ b/ipc/src/subprocess.def
@@ -0,0 +1,8 @@
+LIBRARY subproc INITINSTANCE TERMINSTANCE
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE MULTIPLE NONSHARED
+EXPORTS
+ ; segment TEXT32
+ "_closeOtherFds" ;
magicseg='TEXT32' len=14
+ "_launchProcess" ;
magicseg='TEXT32' len=14
+
diff --git a/util/genxpi b/util/genxpi
index 3f9d365..0d82cb7 100755
--- a/util/genxpi
+++ b/util/genxpi
@@ -78,6 +78,12 @@ if [ ${osArch} = "WINNT" ]; then
spDllFile=
fi
+if [ ${osArch} = "OS2" ]; then
+ # OS/2 has a 8.3 name limitation for DLLs
+ subprocessDLL=subproc.dll
+ spDllFile=subproc.dll
+fi
+
# Prepare chrome.manifest
cat ${srcDir}/package/chrome.manifest \
> ${targetDir}/chrome.manifest
--
2.0.0
Dave
_______________________________________________
enigmail-users mailing list
[email protected]
To unsubscribe or make changes to your subscription click here:
https://admin.hostpoint.ch/mailman/listinfo/enigmail-users_enigmail.net