[27037] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25907 - in trunk/athena/lib/athdir: . src

daemon@ATHENA.MIT.EDU (Alexander Chernyakhovsky)
Tue Apr 9 18:52:26 2013

Date: Tue, 9 Apr 2013 18:52:20 -0400
From: Alexander Chernyakhovsky <achernya@MIT.EDU>
Message-Id: <201304092252.r39MqKHx002840@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: achernya
Date: 2013-04-09 18:52:19 -0400 (Tue, 09 Apr 2013)
New Revision: 25907

Modified:
   trunk/athena/lib/athdir/configure.ac
   trunk/athena/lib/athdir/src/athdir.c
Log:
Update configure.ac to have more checks, also fix the HOSTTYPE_* brokeness to actually work

Modified: trunk/athena/lib/athdir/configure.ac
===================================================================
--- trunk/athena/lib/athdir/configure.ac	2013-04-09 21:49:44 UTC (rev 25906)
+++ trunk/athena/lib/athdir/configure.ac	2013-04-09 22:52:19 UTC (rev 25907)
@@ -11,8 +11,14 @@
 AC_CONFIG_HEADERS([config.h])
 
 # Checks for programs.
+AC_PROG_CXX
+AC_PROG_AWK
 AC_PROG_CC
+AC_PROG_CPP
 AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
 # automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 LT_INIT
@@ -32,11 +38,26 @@
 
 # More stuff
 AS_IF([test x"$ATHENA_SYS" = x], [AC_MSG_ERROR([ATHENA_SYS must be set])])
-AS_IF([test x"$ATHENA_HOSTTYPE" = x], [AC_MSG_ERROR([ATHENA_HOSTTYPE must be set])])
 AC_DEFINE_UNQUOTED([ATHSYS], ["$ATHENA_SYS"], [Define the Athena System Version])
-AC_DEFINE_UNQUOTED([HOSTTYPE_$ATHENA_HOSTTYPE], [Define the type of the Athena System])
 
+AC_ARG_WITH([hosttype],
+    [AS_HELP_STRING([--with-hosttype],
+                    [machtype for compatibility])],
+    [
+	case $withval in
+	     linux)	withval='"linux"';;
+	     sun4)    	withval='"sun4"';;
+	     inbsd)	withval='"inbsd"';;
+	     yes)	withval='"linux"';;
+	     no)	withval=NULL;;
+	     *)		AC_MSG_ERROR([invalid hosttype specified]);;
+	esac
+	hosttype=$withval
+    ],
+    [hosttype='"linux"'])
+AC_DEFINE_UNQUOTED([HOSTTYPE], [$hosttype], [Define the type of the Athena System])
 
+
 AC_CONFIG_FILES([Makefile
                  src/Makefile
 		 src/athdir.pc

Modified: trunk/athena/lib/athdir/src/athdir.c
===================================================================
--- trunk/athena/lib/athdir/src/athdir.c	2013-04-09 21:49:44 UTC (rev 25906)
+++ trunk/athena/lib/athdir/src/athdir.c	2013-04-09 22:52:19 UTC (rev 25907)
@@ -44,17 +44,10 @@
 #include "stringlist.h"
 #include "config.h"
 
-/* Define HOSTTYPE for the platforms where `machtype`bin has historic
- * use.  Never add new platforms to this list.
- */
-#if defined(HOSTTYPE_sun4)
-#define HOSTTYPE "sun4"
-#elif defined(HOSTTYPE_linux)
-#define HOSTTYPE "linux"
-#elif defined(HOSTTYPE_inbsd)
-#define HOSTTYPE "inbsd"
-#endif
-
+/* HOSTTYPE should always be defined when we get here, because
+   configure is responsible for getting it to us. Nonetheless, this
+   codepath is beign left in for legacy reasons, like the rest of this
+   entire file... */
 #ifdef HOSTTYPE
 char *hosttype = HOSTTYPE;
 #else


home help back first fref pref prev next nref lref last post