Define sizeof(long) and switch to lib64 for some platforms.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Wed, 23 Jul 2008 20:41:19 +0000 (20:41 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Wed, 23 Jul 2008 20:41:19 +0000 (20:41 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@514 de75baf8-a10c-0410-a50a-987c0e22f00f

configure.ac
xmltooling/util/PathResolver.cpp

index 3e22b5a..2edc85e 100644 (file)
@@ -61,6 +61,7 @@ AC_PROG_LIBTOOL
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF([long])
 
 # Checks for library functions.
 AC_CHECK_FUNCS([strchr strdup strstr timegm strcasecmp])
index f894d2f..f4d4975 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Copyright 2001-2007 Internet2
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -16,8 +16,8 @@
 
 /**
  * PathResolver.cpp
- * 
- * Resolves local filenames into absolute pathnames. 
+ *
+ * Resolves local filenames into absolute pathnames.
  */
 
 #include "internal.h"
@@ -32,9 +32,15 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char*
     if (!isAbsolute(s.c_str())) {
         switch (filetype) {
             case XMLTOOLING_LIB_FILE:
-                s = string(prefix ? prefix : m_defaultPrefix) + "/lib/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
+                s = string(prefix ? prefix : m_defaultPrefix) +
+#if (SIZEOF_LONG == 8)
+                    "/lib64/"
+#else
+                    "/lib/"
+#endif
+                    + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
                 break;
-                
+
             case XMLTOOLING_LOG_FILE:
                 if (prefix || m_defaultPrefix != "/usr")
                     s = string(prefix ? prefix : m_defaultPrefix) + "/var/log/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
@@ -59,7 +65,7 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char*
                 else
                     s = string("/etc/") + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
                 break;
-            
+
             default:
                 throw XMLToolingException("Unknown file type to resolve.");
         }