how to build mp4v2 for iphone - iphone

I'm new to ios development, and I want to use the mp4v2 library. I have successfully compiled for iphone simulator, i386, but am having trouble compiling for the iphone architecture. Configuring/Make-ing for i386 was easy:
./configure --disable-gch --enable-ub=i386
However, using armv6/7 as a tag didn't work
./configure --disable-gch --enable-ub=armv6,armv7
While configuring worked, the make command led to the error below:
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -arch i386 -arch armv6 -arch armv7 -I./include -I./include -I. -I. -Wall -Wformat -g -O2 -fvisibility=hidden -c -o src/3gp.lo src/3gp.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -arch i386 -arch armv6 -arch armv7 -I./include -I./include -I. -I. -Wall -Wformat -g -O2 -fvisibility=hidden -c src/3gp.cpp -fno-common -DPIC -o src/.libs/3gp.o
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/b6/vmqqncd55k79nb1nc4x30nwr0000gn/T//cctU2lnr.out
make: *** [src/3gp.lo] Error 1
How do I compile for iphone?

I guess that this error is caused by trying to find cross compiler from system root path /usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2 instead of from Developer document.
A little stupid solution is create a symbolic link llvm-gcc-4.2 in system root path /usr, pointing to the real path.

I beleive you may need to verify your xcode-select(1) value so your path includes the new xcode release tree. The tools should have been found under /Applications/xcode with the latest release.

Related

requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

I'm building a gst-plugin through yocto 1.6. I've linaro 4.9 cross toolchain of 32 and 64-bit.
When I'm building the plugin using 64-bit toolchain, it was success ( I got the plugin .so file) whereas if I build the same source using 32-bit toolchain I got the below error
/home/build-directory/tmp/sysroots/x86_64-linux/usr/libexec/cortexa8hf-vfp-neon-rdk-linux-gnueabi/gccgcc/arm-rdk-linux-gnueabi/4.9.4/ld: error: .libs/libgstpluginxxx_la-gstpluginxxx.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
here the whole error
./arm-rdk-linux-gnueabi-libtool --tag=CC --tag=disable-static --mode=link arm-rdk-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -fno-omit-frame-pointer -fno-optimize-sibling-calls --sysroot=/home/sysroots/path -pthread -I/home/sysroots/path/usr/include/gstreamer-1.0 -I/home/sysroots/path/usr/include/glib-2.0 -I/home/sysroots/path/usr/lib/glib-2.0/include -O2 -pipe -g -feliminate-unused-debug-types -fPIC -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o libgstpluginxxx.la -rpath /usr/lib/gstreamer-1.0 libgstpluginxxx_la-gstpluginxxx.lo -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
arm-rdk-linux-gnueabi-libtool: link: arm-rdk-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -enable-shared -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -fno-omit-frame-pointer -fno-optimize-sibling-calls --sysroot=/home/sysroots/path -shared -fPIC -DPIC .libs/libgstpluginxxx_la-gstpluginxxx.o /home/sysroots/path/usr/lib/libgstreamer-1.0.so -L/home/sysroots/path/usr/lib /home/sysroots/path/usr/lib/libgmodule-2.0.so -lm -ldl /home/sysroots/path/usr/lib/libgobject-2.0.so /home/sysroots/path/usr/lib/libffi.so /home/sysroots/path/usr/lib/libglib-2.0.so -lpthread -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/sysroots/path -pthread -O2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -pthread -Wl,-soname -Wl,libgstpluginxxx.so.0 -o .libs/libgstpluginxxx.so.0.0.0
/home/build-directory/tmp/sysroots/x86_64-linux/usr/libexec/cortexa8hf-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.9.4/ld: error: .libs/libgstpluginxxx_la-gstpluginxxx.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
I was confused, why the build was failed to recompile with -fPIC though it was mentioned in the linking command? I tried -fPIC option manually everywhere in the Makefile and libtool script, but no use :(
and
without modifying the source and recipe file, it was success in 32-bit toolchain whereas failed in 64-bit toolchain and telling to recompile with -fPIC option
Below are the build machine info.
BB_VERSION = "1.28.0"
BUILD_SYS = "i686-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
This is likely a bug in gold linker. similar to
https://sourceware.org/ml/binutils/2010-12/msg00473.html
It seems you are using gold linker as default ld. So please pass
LDFLAGS += "-fuse-ld=bfd"
in recipe for this package. and see if that helps. This will force GNU BFD linker to be used for this package.
I was confused, why the build was failed to recompile with -fPIC though it was mentioned in the linking command? I tried -fPIC option manually everywhere in the Makefile and libtool script, but no use :(
Regarding these statements...
make distclean should clean all artifacts so everything gets rebuilt. You will also need to reconfigure.
Before you reconfigure, open your configure.ac and be sure you have a LT_INIT that includes pic-only:
AC_INIT([Crypto++], [8.3], ...)
LT_INIT([pic-only,enable-shared,enable-static])
AM_INIT_AUTOMAKE
...

Compiling a dll with mingw and eclipse

I want to write a tool to capture and visualize pressed keys in a specific application so I searched for a sample source.
My result was this:
http://www.codeguru.com/cpp/w-p/system/keyboard/article.php/c5699
But it doesn't work yet. Here's my approach:
I have imported the sources as makefile project in Elipse (Helios, CDT Version 7.0.0.201006141710) using Mingw 4.6.1 as toolchain.
In keydll3.cpp I added the line
#define KEYDLL3_EXPORTS
to tell the preprocessor that i want to export the dll functions.
Now when I try to compile the project, the following errors occour:
**** Internal Builder is used for build ****
g++ -shared -DBUILDING_EXAMPLE_DLL -IC:\MinGW\include -IC:\MinGW\lib\gcc\mingw32\4.6.1\include\c++ -O2 -g -Wall -c -fmessage-length=0 -oStdAfx.o ..\StdAfx.cpp
g++ -shared -DBUILDING_EXAMPLE_DLL -IC:\MinGW\include -IC:\MinGW\lib\gcc\mingw32\4.6.1\include\c++ -O2 -g -Wall -c -fmessage-length=0 -okeydll3.o ..\keydll3.cpp
..\keydll3.cpp:31:0: warning: ignoring #pragma data_seg [-Wunknown-pragmas]
..\keydll3.cpp:34:0: warning: ignoring #pragma data_seg [-Wunknown-pragmas]
..\keydll3.cpp:36:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
g++ -okeydll3 keydll3.o StdAfx.o
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libmingw32.a(main.o): In function `main':
C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMain#16'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
It seems that the compiler misses the winmain statement because he assume it's a windows application. But a dll isn't.
It also seems that the "-share" option has no effect.
So how do I tell the compiler that my code is a dll with some Windows API calls?
If there's another example which works without visual studio let me know.
Thanks in advance for your contributions.
Noir
You've added the -shared option in the wrong place. It needs to be added to the linker flags, not to the compiler flags. Your commands should look like this.
g++ -DBUILDING_EXAMPLE_DLL -IC:\MinGW\include -IC:\MinGW\lib\gcc\mingw32\4.6.1\include\c++ -O2 -g -Wall -c -fmessage-length=0 -oStdAfx.o ..\StdAfx.cpp
g++ -DBUILDING_EXAMPLE_DLL -IC:\MinGW\include -IC:\MinGW\lib\gcc\mingw32\4.6.1\include\c++ -O2 -g -Wall -c -fmessage-length=0 -okeydll3.o ..\keydll3.cpp
g++ -shared -okeydll3 keydll3.o StdAfx.o

Compiling FreeType for iPhone?

I'm using FreeType on Windows, Linux and OSX without a single problem, and now I was to port my tech to IOS...
And I can't find a way to have FreeType compiled for it.
At first I tried to drop every FT file into my project, but that clearly didn't work.
Then I tried to make a static library following this tutorial here.
While I can't test if it worked for the arm target, it doesn't work for the simulator target.
When trying to link the built library into XCode it says "libfreetype-simulator.a, file was built for archive which is not the architecture being linked (i386)"
and that's ok because the command "lipo -info libfreetype-simulator.a" tells me that the file was built for x86_64.
I tried configuring it with "./configure --i386-apple-darwin", here's the log.
But still, the resulting arch was x86_64.
How in the world can I build freetype for i386, iphone simulator?
I really have no clues.
I used the link in cxa's answer. However it is very out of date, and my configure line did not fit in a comment. For armv7, compiling with the 6.1 SDK, with a minimum version of 5.1, without bzip2, you want something like:
./configure '--without-bzip2' '--prefix=/usr/local/iphone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 'CFLAGS=-arch armv7 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=5.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/libxml2/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/ -miphoneos-version-min=5.1'
Note the lack of -mdynamic-no-pic which would otherwise produce a linker warning, and a warning email from Apple, if left in. Also note that various pathnames have changed.
I came across this project today while trying to compile FreeType for iOS: https://github.com/cdave1/freetype2-ios
Just download, open in xcode, and compile. :)
Hope this is helpful for anyone else trying to compile for iOS.
For Xcode 5, gcc has moved location so the configuration should be:
./configure --without-zlib --without-png --without-bzip2 '--prefix=/usr/local/iPhone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-arch armv7 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=6.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/libxml2/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/ -miphoneos-version-min=6.1'
The location of CC can be found by running:
$ xcrun -find -sdk iphoneos clang
For iOS SDK 8.1 with a min target of 7.1 on Xcode 6.1, this works:
./configure --without-zlib --without-png --without-bzip2 '--prefix=/usr/local/iPhone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-arch armv7 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=7.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libxml2/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/ -miphoneos-version-min=7.0'
Maybe someone will find it usefull. SDK 8.1, XCode 6.1
i386,x86_64,arm64 (for profiling) ,armv7,armv7s
./configure CFLAGS="-arch i386"
make clean
make
cp objs/.libs/libfreetype.a libfreetype-i386.a
./configure CFLAGS="-arch x86_64"
make clean
make
cp objs/.libs/libfreetype.a libfreetype-x86_64.a
./configure --without-zlib --without-png --without-bzip2 '--prefix=/usr/local/iPhone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-arch armv7 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=7.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libxml2/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/ -miphoneos-version-min=7.0'
make clean
make
cp objs/.libs/libfreetype.a libfreetype-armv7.a
./configure --without-zlib --without-png --without-bzip2 '--prefix=/usr/local/iPhone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-arch arm64 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=7.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libxml2/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/ -miphoneos-version-min=7.0'
make clean
make
cp objs/.libs/libfreetype.a libfreetype-arm64.a
./configure --without-zlib --without-png --without-bzip2 '--prefix=/usr/local/iPhone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-arch armv7s -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=7.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libxml2/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/ -miphoneos-version-min=7.0'
make clean
make
cp objs/.libs/libfreetype.a libfreetype-armv7s.a
lipo -create -output libfreetype.a libfreetype-i386.a libfreetype-x86_64.a libfreetype-armv7.a libfreetype-armv7s.a libfreetype-arm64.a
This shell script works for me, x86_64. You maybe need to have a look.
I used it to compile freetype2.5.5, and got armv7, arm64, i386, x86_64.Of course it lipo to a single fat static library.
For freetype to compile smoothly it's important to pass the variables 'CC', 'CFLAGS', 'LDFLAGS' and 'AR' as arguments to configure and not as environment variables.
at some point configure runs the native gcc of the machine and if you have 'LDFLAGS' that point to the iphone SDK it will cause it to fail. passing the variables to configure seems to solve this issue.

how to compile iphone code using makefile?

I want to compile an iPhone app using make command. But it always shows error
make: /opt/iphone/bin/arm-apple-darwin-gcc: No such file or directory
make: *** [src/main.o] Error 1
Here are the makefile contents.
CC=/opt/iphone/bin/arm-apple-darwin-gcc \
-isysroot /opt/iphone/addons/1.0.2/system \
-isystem /opt/iphone/include \
-isystem /opt/iphone/include/gcc/darwin/3.3 \
-F/opt/iphone/addons/1.0.2/system/System/Library/Frameworks
How do i compile my app. I am not familiar with unix commands. So please guide me step by step.
Update
Now getting error after changing paths.
from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOs4.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOs4.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:9,
from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOs4.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9,
from src/main.m:23:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOs4.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h: At top level:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOs4.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:15: error: syntax error before ‘BOOL’
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOs4.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:16: fatal error: method definition not in #implementation context
compilation terminated.
make: *** [src/main.o] Error 1
Replace /opt/iphone/ by /Developer/Platforms/iPhoneOS.platform/Developer/usr/ or whereever your gcc is located. If I look into my bin sub-directory there is no arm-apple-darwin-gcc but a arm-apple-darwin10-llvm-gcc-4.2.
Open a terminal and type
cd /Developer/Platforms/iPhoneOS.platform/Developer/usr
ls bin/
Now you will see a list of compilers available on your system. BTW: I don't have an addons directory so I guess it is part of some special software package you have installed.
[Update]:
Following flags are set in XCode:
-x objective-c -arch armv7 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -gdwarf-2 -mthumb -miphoneos-version-min=4.2
I don't know that much about the details of every flag, but it's worth a try to set them in CC within your makefile.

Unable to install the Crypt-SSLeay module

I'm creating a web application that requires the use of the perl module Crypt-SSLeay. This module has a dependency of needing OpenSSL headers. Since my Linux server has neither I went through these steps to install, but I'm receiving an error that's hard to understand (see below) because of my limited experience.
Server Information:
Running Oracle Enterprise Linux
Linux version 2.6.18-194.11.4.0.1.el5 (mockbuild#ca-build9.us.oracle.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))
Steps to replicate the issue:
Downloaded and extracted openssl 0.9.8r from here and ran the following commands (after going to the directory)
./config --openssldir=/usr/local/openssl
make
make test
sudo make install
Downloaded and extracted the Crypt-SSLeay module from here and then ran the following commands (after going to the directory)
perl Makefile.PL
make
I receive the following error after I run "make":
BUILD INFORMATION
================================================
ssl library: OpenSSL 0.9.8r in /usr/local/openssl
ssl header: openssl/ssl.h
libraries: -L/usr/local/openssl/lib -lssl -lcrypto -lgcc
include dir: -I/usr/local/openssl/include
================================================
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N]
-bash-3.2$ make
gcc -c -I/usr/local/openssl/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"0.58\" -DXS_VERSION=\"0.58\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" SSLeay.c
SSLeay.c: In function ‘XS_Crypt__SSLeay__CTX_new’:
SSLeay.c:118: warning: unused variable ‘packname’
SSLeay.c: In function ‘XS_Crypt__SSLeay__Conn_new’:
SSLeay.c:395: warning: unused variable ‘packname’
SSLeay.c: In function ‘XS_Crypt__SSLeay__CTX_use_pkcs12_file’:
SSLeay.c:287: warning: ‘RETVAL’ may be used uninitialized in this function
Running Mkbootstrap for Crypt::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic SSLeay.o -o blib/arch/auto/Crypt/SSLeay/SSLeay.so \
-L/usr/local/openssl/lib -lssl -lcrypto \
/usr/bin/ld: /usr/local/openssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Crypt/SSLeay/SSLeay.so] Error 1
I'm not sure what I need to do when I recompile OpenSSL to get this module to work. Any help appreciated.
That looks like an error in the OpenSSL build itself. Are you sure your distribution doesn't provide the OpenSSL headers? (And i'm sure you already had the libraries, right?)
The headers are in a package called "openssl-devel" on RedHat IIRC, should be the same for Oracle Enterprise Linux (I guess, never used that).
If you do find the headers in your distro's packages, don't forget to un-install your custom build (remove the files manually if the OpenSSL Makefile doesn't have an uninstall target).