[scponly] moving SOLARIS_COMPAT to UNIX_COMPAT -> building on AIX

Sven Hoexter sven at timegate.de
Sun Oct 31 12:36:14 EST 2004


Hi,
the attached patch renames SOLARIS_COMPAT to UNIX_COMPAT and adds an temp_os
hack for AIX so that AIX will be detected aswell.
With this patch I can compile scponly on a AIX 5.1L box with the needed gnu
tools [1] installed.

Kudos to Jan van Beers for lending me his good old RS/6k

HTH
Sven

[1] http://www-1.ibm.com/servers/aix/products/aixos/linux/download.html
-- 
Revolution is not a dinner party, not an essay, nor a painting, nor a piece of
embroidery; it cannot be advanced softly, gradually, carefully, considerately,
respectfully, politely, plainly, and modestly.
- Mao Zedong (Mao Tse-tung)
-------------- next part --------------
diff -ur scponly-3.11-orig/config.h.in scponly-3.11/config.h.in
--- scponly-3.11-orig/config.h.in	2004-03-22 06:29:48.000000000 +0100
+++ scponly-3.11/config.h.in	2004-10-31 18:22:48.000000000 +0100
@@ -3,7 +3,7 @@
 #undef PACKAGE_BUGREPORT
 
 /* Features */
-#undef SOLARIS_COMPAT
+#undef UNIX_COMPAT
 #undef IRIX_COMPAT
 #undef WINSCP_COMPAT
 #undef GFTP_COMPAT
diff -ur scponly-3.11-orig/configure.in scponly-3.11/configure.in
--- scponly-3.11-orig/configure.in	2004-03-22 09:00:38.000000000 +0100
+++ scponly-3.11/configure.in	2004-10-31 18:22:48.000000000 +0100
@@ -26,13 +26,16 @@
 # this temp_os is a brutal hack until i look into the proper way to do this. ie- rtfm
 temp_os=`echo $host_os | cut -c-7`
 if test "$temp_os" = solaris; then
-	AC_DEFINE(SOLARIS_COMPAT)
+   AC_DEFINE(UNIX_COMPAT)
 fi
 temp_os=`echo $host_os | cut -c-4`
 if test "$temp_os" = irix;  then
-  AC_DEFINE(IRIX_COMPAT)
+   AC_DEFINE(IRIX_COMPAT)
+fi
+temp_os=`echo $host_os | cut -c-3`
+if test "$temp_os" = aix; then
+   AC_DEFINE(UNIX_COMPAT)
 fi
-
 
 AC_DEFINE(HOST_OS,$host_os)
 
diff -ur scponly-3.11-orig/helper.c scponly-3.11/helper.c
--- scponly-3.11-orig/helper.c	2003-03-08 01:23:26.000000000 +0100
+++ scponly-3.11/helper.c	2004-10-31 18:22:48.000000000 +0100
@@ -30,7 +30,7 @@
 extern char homedir[FILENAME_MAX];
 extern cmd_t commands[];
 
-#ifdef SOLARIS_COMPAT
+#ifdef UNIX_COMPAT
 char* solaris_needs_strsep(char** str, char* delims)
 {
     char* tmpstr;
@@ -167,7 +167,7 @@
 				*tmpstring++='\0';
 				*ap=(inputstring+1);
 				
-#ifdef SOLARIS_COMPAT
+#ifdef UNIX_COMPAT
 				if (solaris_needs_strsep(&tmpstring, WHITE) == NULL)
 #else
 				if (strsep(&tmpstring, WHITE) == NULL)
@@ -181,7 +181,7 @@
 			}
 		}
 		
-#ifdef SOLARIS_COMPAT
+#ifdef UNIX_COMPAT
         	if ((*ap = solaris_needs_strsep(&inputstring, WHITE)) == NULL)
 #else
         	if ((*ap = strsep(&inputstring, WHITE)) == NULL)
@@ -212,7 +212,7 @@
 	char		**av_new=(char **)malloc(MAX_ARGC * (sizeof(char *)));
 	glob_t g;
 	int c_old,c_new,c;	// argument counters
-#ifdef SOLARIS_COMPAT
+#ifdef UNIX_COMPAT
 	int flags = GLOB_NOCHECK;
 #else
 	int flags = GLOB_NOCHECK | GLOB_TILDE;
diff -ur scponly-3.11-orig/scponly.c scponly-3.11/scponly.c
--- scponly-3.11-orig/scponly.c	2004-03-22 06:30:38.000000000 +0100
+++ scponly-3.11/scponly.c	2004-10-31 18:22:48.000000000 +0100
@@ -79,12 +79,12 @@
 		fscanf(debugfile,"%u",&debuglevel);
 		fclose(debugfile);
 	}
-#ifndef SOLARIS_COMPAT
+#ifndef UNIX_COMPAT
 	if (debuglevel > 1) // debuglevel 1 will still log to syslog
 		logopts |= LOG_PERROR;
 #endif
 
-#ifdef SOLARIS_COMPAT 
+#ifdef UNIX_COMPAT 
         openlog(PACKAGE_NAME, logopts, LOG_AUTH);
 #elif IRIX_COMPAT
         openlog(PACKAGE_NAME, logopts, LOG_AUTH);
@@ -120,7 +120,7 @@
 			syslog(LOG_DEBUG, "\targ %u is %s", i, argv[i]);
 	}
         if (debuglevel)
-#ifdef SOLARIS_COMPAT
+#ifdef UNIX_COMPAT
                 syslog(LOG_DEBUG, "opened log at LOG_AUTH, opts 0x%08x", logopts);
 #else
                 syslog(LOG_DEBUG, "opened log at LOG_AUTHPRIV, opts 0x%08x", logopts);


More information about the scponly mailing list