Define sizeof(long) and switch to lib64 for some platforms.
authorScott Cantor <cantor.2@osu.edu>
Wed, 23 Jul 2008 20:41:19 +0000 (20:41 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 23 Jul 2008 20:41:19 +0000 (20:41 +0000)
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
 # 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])
 
 # 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
 /*
  *  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
  * 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
 
 /**
  * PathResolver.cpp
- * 
- * Resolves local filenames into absolute pathnames. 
+ *
+ * Resolves local filenames into absolute pathnames.
  */
 
 #include "internal.h"
  */
 
 #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:
     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;
                 break;
-                
+
             case XMLTOOLING_LOG_FILE:
                 if (prefix || m_defaultPrefix != "/usr")
                     s = string(prefix ? prefix : m_defaultPrefix) + "/var/log/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
             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;
                 else
                     s = string("/etc/") + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
                 break;
-            
+
             default:
                 throw XMLToolingException("Unknown file type to resolve.");
         }
             default:
                 throw XMLToolingException("Unknown file type to resolve.");
         }