Hi,

I am trying to get Kannel 1.4.1 to compile and run on AIX 5.2 using gcc 4.0 and 
libxml2 2.6.23. To do so, I had to make two small changes to the source code:


--- gateway-1.4.1.orig/gw/smsc/smsc_emi_x25.c   2005-02-11 15:35:48.000000000 
+0000
+++ gateway-1.4.1/gw/smsc/smsc_emi_x25.c        2008-07-01 08:51:47.000000000 
+0100
@@ -496,8 +496,17 @@

     /* The speed initialisation is pretty important. */
     tcgetattr(fd, &tios);
+/* Choose the fastest speed available (assuming at least 38400 baud). 
+*/ #if defined(B115200)
     cfsetospeed(&tios, B115200);
     cfsetispeed(&tios, B115200);
+#elif defined(B57600)
+    cfsetospeed(&tios, B57600);
+    cfsetispeed(&tios, B57600);
+#elif defined(B38400)
+    cfsetospeed(&tios, B38400);
+    cfsetispeed(&tios, B38400);
+#endif
     kannel_cfmakeraw(&tios);
     tios.c_cflag |= (HUPCL | CREAD | CRTSCTS);
     tcsetattr(fd, TCSANOW, &tios);


And


--- gateway-1.4.1.orig/gw/smsc/smsc_soap.c      2005-09-19 23:07:33.000000000 
+0100
+++ gateway-1.4.1.gcc/gw/smsc/smsc_soap.c       2008-07-01 09:20:56.000000000 
+0100
@@ -223,7 +223,9 @@
 /* useful macros go here (some of these were ripped of other modules,
    so maybe its better to put them in a shared file) */
 #define        O_DESTROY(a)    { if(a) octstr_destroy(a); a=NULL; }
+#if !defined(__64BIT__)
 typedef long long int64;
+#endif

 /*
  * SOAP module public API towards bearerbox


This second change is questionable but indicates the problem: when compiling in 
64 bit mode, AIX already defines int64.

I am fairly sure that B38400 can be assumed to be defined but you could extend 
the patch to check for lower baud rates.

I also tried building using the native AIX compiler which, in addition to the 
above changes, requires that all the C++-style comments be converted to C-style 
comments (there's probably a compiler switch that allows C++-style comments but 
by default they are rejected).

The build system assumes gcc (for the generation of include dependencies via 
the -MM option) which is unfortunate.

Regards,

James Bostock

Reply via email to