I don't think this configuration is supported (maybe gcc isn't supported at all) because the esql script uses xlc options only.
But I want to know if other people are using this configuration gcc and informix 64 bits in AIX.
I don't think this configuration is supported (maybe gcc isn't supported at all) because the esql script uses xlc options only.
But I want to know if other people are using this configuration gcc and informix 64 bits in AIX.
You can get ESQL/C (a part of ClientSDK or CSDK) to use GCC, but it isn't completely trivial. In principle, what I do is:
If you only want to use GCC, then this is sufficient. If you want to use both GCC and sometimes XLC (the native compiler), then it is harder.
I have a single script called esql in my private bin directory (which is always on my PATH ahead of things like $INFORMIXDIR/bin). It works out which version of ESQL/C I'm currently using, and runs the appropriate pre-patched version which is stored in a separate directory. And it automatically creates new versions of that script for me so if I work with CSDK 3.00.UC2 one minute and then CSDK 3.50.FC3 the next, it handles the switchover automatically.
Here's the patch applied to ESQL/C 3.50 on Solaris - you'll need to adapt it to AIX.
# @(#)$Id: patch.300.64,v 1.2 2007/09/02 21:46:55 jleffler Exp $
# GCC Patch for esql from CSDK 3.00.FC1
--- esql 2007-09-02 14:44:18.739067000 -0700
+++ esql.new 2007-09-02 14:44:26.812149000 -0700
@@ -23,10 +23,33 @@
INFDIR=${INFORMIXDIR=/usr/informix}
DB2CLIDIR=${INSTHOME=/usr/db2}
PREPCC=${INFDIR}/lib/esql/esqlc
-CC="${INFORMIXC=cc} -xarch=v9"
-CC_TH="${INFORMIXC=cc} -xarch=v9"
-CPP="${INFORMIXCPP=CC} -xarch=v9"
-CPP_TH="${INFORMIXCPP=CC} -xarch=v9"
+
+: ${INFORMIXC:=cc}
+: ${INFORMIXCPP:=CC}
+case "$INFORMIXC" in
+*perl*esqlcc*) # Building DBD::Informix
+ case "$ESQLCC" in
+ *gcc*|*g++)
+ CC_ARCHFLAGS="-m64"
+ ;;
+ *cc*|*CC*)
+ CC_ARCHFLAGS="-xarch=v9"
+ ;;
+ esac
+ ;;
+*gcc*|*g++*)
+ CC_ARCHFLAGS="-m64"
+ ;;
+# Beware - this normally needs to be last - because things like esqlcc and gcc match too!
+*cc*|*CC*)
+ CC_ARCHFLAGS="-xarch=v9"
+ ;;
+esac
+
+CC="$INFORMIXC $CC_ARCHFLAGS"
+CC_TH="$INFORMIXC $CC_ARCHFLAGS"
+CPP="$INFORMIXCPP $CC_ARCHFLAGS"
+CPP_TH="$INFORMIXCPP $CC_ARCHFLAGS"
STATICFLAGS=""
CP=${INFORMIXCP="$CC -E -C"} # cpp which runs before esqlc
@@ -51,9 +74,6 @@
then
CC="$CC $CC_AMD32"
CPP="$CPP $CC_AMD32"
-else
-CC=$CC
-CPP=$CPP
fi
: '
@@ -922,7 +942,7 @@
# Set the linker to CPP
# Set the source files to objects
#
- CC=$CPP
+ CC="$CPP"
A="$AO $CPPOPTS"
fi
fi
Lemme know if you want the controlling esql
script that I use (see my profile). I have 9 32-bit scripts and 8 64-bit scripts, created by a set of 12 different patch files (all for Solaris, I'm afraid). The versions range from ESQL/C 5.20 (for OnLine 5.20) via ESQL/C 7.2x (long dead officially) through various versions of CSDK.