[ap-utils] Solaris build problems

Daniel E. Eisenbud eisenbud at cbio.mskcc.org
Fri Feb 27 01:07:27 EET 2004


On Thu, Feb 26, 2004 at 10:20:07PM +0200, Roman Festchook <roma at polesye.net> wrote:
> Thank you for argumented suggections and help in porting - now support for 
> Solaris with SysV curses added into package. As usual need your help in 
> testing:
> http://ap-utils.polesye.net/files/ap-utils-latest.tar.bz2

Great, thanks!  It didn't build, but the attached patch makes it work.
ap-curses.h has to be included after ap-utils.h to see the #define
OS_SOLARIS.  There was one other include file ordering issue in
ap_search.c -- <sys/sockio.h> has to come before <net/if.h>.

It might be better to add a specific autoconf check for ncurses.h, and
if that's not there, use curses.h and -lcurses, rather than making
dependant on Solaris, since lots of people do use ncurses on Solaris (it
at least used to be faster and generally nicer.)  That way you might
have a chance of compiling out of the box on other platforms without
ncurses, too.

Thanks,
Daniel

-- 
Daniel E. Eisenbud
eisenbud at cbio.mskcc.org
Computational Biology Center
Memorial Sloan-Kettering Cancer Center
-------------- next part --------------
diff -durp ap-utils-1.4.1pre3b/ap-gl/auth_mac.c ap-utils-1.4.1pre3b-working/ap-gl/auth_mac.c
--- ap-utils-1.4.1pre3b/ap-gl/auth_mac.c	Thu Feb 26 14:46:39 2004
+++ ap-utils-1.4.1pre3b-working/ap-gl/auth_mac.c	Thu Feb 26 17:59:06 2004
@@ -21,8 +21,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define MAX_LINES LINES-6
 #define PACKET_ERROR _("AuthorizedMacTableString packet error")
diff -durp ap-utils-1.4.1pre3b/lib/ap_search.c ap-utils-1.4.1pre3b-working/lib/ap_search.c
--- ap-utils-1.4.1pre3b/lib/ap_search.c	Thu Feb 26 14:49:28 2004
+++ ap-utils-1.4.1pre3b-working/lib/ap_search.c	Thu Feb 26 17:57:25 2004
@@ -25,18 +25,20 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+
+#include "ap-utils.h"
+
+#ifdef OS_SOLARIS
+#include <sys/sockio.h>
+#endif
+
 #include <net/if.h>
 #include <sys/time.h>
 #include <errno.h>
 #include "ap-curses.h"
-#include "ap-utils.h"
 
 #if defined (__GLIBC__)
 #include <libgen.h>
-#endif
-
-#ifdef OS_SOLARIS
-#include <sys/sockio.h>
 #endif
 
 #define MAX_APS 10
diff -durp ap-utils-1.4.1pre3b/lib/aps.c ap-utils-1.4.1pre3b-working/lib/aps.c
--- ap-utils-1.4.1pre3b/lib/aps.c	Thu Feb 26 14:49:43 2004
+++ ap-utils-1.4.1pre3b-working/lib/aps.c	Thu Feb 26 17:39:53 2004
@@ -24,8 +24,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <stdlib.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 extern WINDOW *main_sub/*, *win_for_menu*/;
 extern short ap_type;
diff -durp ap-utils-1.4.1pre3b/lib/cmd.c ap-utils-1.4.1pre3b-working/lib/cmd.c
--- ap-utils-1.4.1pre3b/lib/cmd.c	Thu Feb 26 14:50:06 2004
+++ ap-utils-1.4.1pre3b-working/lib/cmd.c	Thu Feb 26 17:39:26 2004
@@ -19,8 +19,8 @@
  */
 
 #include <unistd.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define ANSW_NO _("(Y - Yes; N - No (it's safer to answer No, unless you really need this.)")
 
diff -durp ap-utils-1.4.1pre3b/lib/file.c ap-utils-1.4.1pre3b-working/lib/file.c
--- ap-utils-1.4.1pre3b/lib/file.c	Thu Feb 26 14:51:15 2004
+++ ap-utils-1.4.1pre3b-working/lib/file.c	Thu Feb 26 17:57:42 2004
@@ -19,7 +19,6 @@
  *
  */
 #include <sys/wait.h>
-#include "ap-curses.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <fcntl.h>
@@ -27,6 +26,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 extern WINDOW *main_sub, *win_for_help, *main_win;
 extern char *ap_types[];
diff -durp ap-utils-1.4.1pre3b/lib/input.c ap-utils-1.4.1pre3b-working/lib/input.c
--- ap-utils-1.4.1pre3b/lib/input.c	Thu Feb 26 14:52:17 2004
+++ ap-utils-1.4.1pre3b-working/lib/input.c	Thu Feb 26 17:37:49 2004
@@ -23,8 +23,8 @@
 #include <string.h>
 #include <unistd.h>
 #include <menu.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 extern WINDOW *main_sub, *win_for_help, *main_win;
 
diff -durp ap-utils-1.4.1pre3b/lib/radio.c ap-utils-1.4.1pre3b-working/lib/radio.c
--- ap-utils-1.4.1pre3b/lib/radio.c	Thu Feb 26 14:49:00 2004
+++ ap-utils-1.4.1pre3b-working/lib/radio.c	Thu Feb 26 17:39:37 2004
@@ -21,8 +21,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <sys/types.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define RADIO_HELP _("[key] - power level; UIOP or LR - antenna; W - write config; Q - quit to menu")
 
diff -durp ap-utils-1.4.1pre3b/lib/scr.c ap-utils-1.4.1pre3b-working/lib/scr.c
--- ap-utils-1.4.1pre3b/lib/scr.c	Thu Feb 26 14:50:13 2004
+++ ap-utils-1.4.1pre3b-working/lib/scr.c	Thu Feb 26 17:38:03 2004
@@ -21,9 +21,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include "ap-curses.h"
 #include <menu.h>
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 extern WINDOW *main_sub, *win_for_help, *main_win;
 
diff -durp ap-utils-1.4.1pre3b/lib/set_community.c ap-utils-1.4.1pre3b-working/lib/set_community.c
--- ap-utils-1.4.1pre3b/lib/set_community.c	Thu Feb 26 14:51:19 2004
+++ ap-utils-1.4.1pre3b-working/lib/set_community.c	Thu Feb 26 17:39:06 2004
@@ -17,13 +17,13 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  */
-#include "ap-curses.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define COMMUNITY_TOP_HEADER _("Set community/password")
 #define COMMUNITY_HEADER1 _("Key Access level")
diff -durp ap-utils-1.4.1pre3b/lib/test.c ap-utils-1.4.1pre3b-working/lib/test.c
--- ap-utils-1.4.1pre3b/lib/test.c	Thu Feb 26 14:51:22 2004
+++ ap-utils-1.4.1pre3b-working/lib/test.c	Thu Feb 26 17:38:41 2004
@@ -18,11 +18,11 @@
  *
  */
 #include <math.h>
-#include "ap-curses.h"
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define TEST_MODE _("[T] Test mode: ")
 #define ANTENNA _("[A] Antenna: ")
diff -durp ap-utils-1.4.1pre3b/lib/wep.c ap-utils-1.4.1pre3b-working/lib/wep.c
--- ap-utils-1.4.1pre3b/lib/wep.c	Thu Feb 26 14:50:23 2004
+++ ap-utils-1.4.1pre3b-working/lib/wep.c	Thu Feb 26 17:38:15 2004
@@ -18,13 +18,13 @@
  *
  */
 
-#include "ap-curses.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define ENCRYPT _("[E] Standard encryption mechanism: ")
 #define ALLOW _("[A] Allow unencrypted: ")
diff -durp ap-utils-1.4.1pre3b/src/auth_mac.c ap-utils-1.4.1pre3b-working/src/auth_mac.c
--- ap-utils-1.4.1pre3b/src/auth_mac.c	Thu Feb 26 14:48:06 2004
+++ ap-utils-1.4.1pre3b-working/src/auth_mac.c	Thu Feb 26 17:58:05 2004
@@ -21,8 +21,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define MAX_LINES LINES-6
 #define PACKET_ERROR _("AuthorizedMacTableString packet error")
diff -durp ap-utils-1.4.1pre3b/src/nwn_advanced.c ap-utils-1.4.1pre3b-working/src/nwn_advanced.c
--- ap-utils-1.4.1pre3b/src/nwn_advanced.c	Thu Feb 26 14:48:18 2004
+++ ap-utils-1.4.1pre3b-working/src/nwn_advanced.c	Thu Feb 26 17:58:26 2004
@@ -21,8 +21,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <menu.h>
-#include "ap-curses.h"
 #include "ap-utils.h"
+#include "ap-curses.h"
 
 #define RATES_RECORD "[%d]   %02.1fM\t%s"
 


More information about the ap-utils mailing list