Opened 10 years ago

Closed 10 years ago

#41804 closed enhancement (fixed)

cryptlib @3.4.1 add universal variant

Reported by: david@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port: cryptlib

Description

I'm trying to port some 32-bit software to Mac and it would be helpful if the cryptlib port had a universal variant.

Change History (6)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Keywords: i386 removed

I did try to make a universal variant for cryptlib 2 years ago, but its makefile says:

#			If you want to build a universal binary you can use the a command
#			a bit like the following (with the path to your SDK install
#			substituted for the one in the command-lines below):
#
# make LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk' CFLAGS='-c -isysroot \
# /Developer/SDKs/MacOSX10.5.sdk -Os -mmacosx-version-min=10.5 -arch ppc -arch \
# ppc64 -arch i386 -arch x86_64 -DOSX_UNIVERSAL_BINARY -D__UNIX__ -DNDEBUG -I.'
#
# make LDFLAGS='-arch i386 -arch x86_64' CFLAGS='-c -O2 -mmacosx-version-min=10.5 \
# -arch i386 -arch x86_64 -D__UNIX__ -DNDEBUG -I.'
#
#			This will also required adding $(LDFLAGS) to the dylib build rule,
#			and removing LDFLAGS="-object -s" from the overall OS X build rule.
#
#			This build method is rather trouble-prone because the low-level
#			crypto code has to configure itself for CPU endianness and word
#			size for the algorithms that require low-level bit fiddling, and
#			uses different code strategies depending on the CPU architecture
#			and bit width.  This single-pass build for multiple architectures
#			often causes problems, and you're more or less on your own if you
#			decide to try it.

So to avoid these problems we have to use the muniversal portgroup, but that adds complications of its own.

comment:2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Specifically, the muniversal portgroup overrides the configure, build and destroot phases. In the configure phase, it duplicates the source directory once for each architecture, then runs the configure.cmd in each one. In the build phase, it runs the build.cmd in each directory. And in the destroot phase, it runs the destroot.cmd in each, pointing each one at a unique destroot directory, and then merges those destroots into a single one. The problem is that the cryptlib port doesn't use a destroot.cmd; it completely overrides the destroot phase, and that doesn't work with the muniversal portgroup.

comment:3 in reply to:  2 Changed 10 years ago by david@…

Replying to ryandesign@…:

Specifically, the muniversal portgroup overrides the configure, build and destroot phases. In the configure phase, it duplicates the source directory once for each architecture, then runs the configure.cmd in each one. In the build phase, it runs the build.cmd in each directory. And in the destroot phase, it runs the destroot.cmd in each, pointing each one at a unique destroot directory, and then merges those destroots into a single one. The problem is that the cryptlib port doesn't use a destroot.cmd; it completely overrides the destroot phase, and that doesn't work with the muniversal portgroup.

Maybe I'm missing something, but the commands in the port's destroot look like they could easily be converted to a shell script. Then distribute the shell script as a patchfile and set destroot.cmd to that shell script? (Sorry, if that's a stupid idea, I'm very new to macports.)

comment:4 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

No you're right, that's probably what should be done. Or better yet made into an "install" target in the makefile. I had probably just already spent too much time on it that I got tired of working on it when I hit this part of the problem.

comment:5 in reply to:  4 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… removed
Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

Replying to ryandesign@…:

No you're right, that's probably what should be done. Or better yet made into an "install" target in the makefile.

This part is done in r114713.

comment:6 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Universal variant added in r114714.

Note: See TracTickets for help on using tickets.