Difference between revisions of "Template:Stub-Header"

From CBLFS
Jump to navigationJump to search
m (Protected "Template:Stub-Header" [edit=sysop:move=sysop])
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==== Creating a Stub Header ====
+
== Creating a Stub Header (Multilib Only) ==
  
  cat > {{{2|/usr/include}}}/{{{1}}} << "EOF"
+
==== Creating a Generic Stub Header ====
  /* {{{1}}} - Stub Header  */
+
 
  #ifndef __STUB__{{#replace:{{UC:{{{1}}}}}|.|_}}__
+
  cat > {{{2|/usr/include}}}/{{{1}}}.h << "EOF"
  #define __STUB__{{#replace:{{UC:{{{1}}}}}|.|_}}__
+
  /* {{{1}}}.h - Stub Header  */
 +
  #ifndef __STUB__{{UC:{{{1}}}}}_H__
 +
  #define __STUB__{{UC:{{{1}}}}}_H__
 
   
 
   
  #if defined(__x86_64) || \
+
  #if defined(__x86_64__) || \
 
     defined(__sparc64__) || \
 
     defined(__sparc64__) || \
 
     defined(__arch64__) || \
 
     defined(__arch64__) || \
Line 16: Line 18:
 
  #endif
 
  #endif
 
   
 
   
  #endif /* __STUB__{{#replace:{{UC:{{{1}}}}}|.|_}}__ */
+
  #endif /* __STUB__{{UC:{{{1}}}}}_H__ */
 
  EOF
 
  EOF
  
 
==== Creating a Stub Header For Mips ====
 
==== Creating a Stub Header For Mips ====
  
  cat > {{{2|/usr/include}}}/{{{1}}} << "EOF"
+
  cat > {{{2|/usr/include}}}/{{{1}}}.h << "EOF"
  /* {{{1}}} - Stub Header  */
+
  /* {{{1}}}.h - Stub Header  */
  #ifndef __STUB__{{#replace:{{UC:{{{1}}}}}|.|_}}__
+
  #ifndef __STUB__{{UC:{{{1}}}}}_H__
  #define __STUB__{{#replace:{{UC:{{{1}}}}}|.|_}}__
+
  #define __STUB__{{UC:{{{1}}}}}_H__
 
   
 
   
 
  #include <sgidefs.h>
 
  #include <sgidefs.h>
Line 36: Line 38:
 
  #endif
 
  #endif
 
   
 
   
  #endif /* __STUB__{{#replace:{{UC:{{{1}}}}}|.|_}}__ */
+
  #endif /* __STUB__{{UC:{{{1}}}}}_H__ */
 
  EOF
 
  EOF

Latest revision as of 11:20, 14 September 2008

Creating a Stub Header (Multilib Only)

Creating a Generic Stub Header

cat > /usr/include/{{{1}}}.h << "EOF"
/* {{{1}}}.h - Stub Header  */
#ifndef __STUB__{{{1}}}_H__
#define __STUB__{{{1}}}_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "{{{1}}}-64.h"
#else
# include "{{{1}}}-32.h"
#endif

#endif /* __STUB__{{{1}}}_H__ */
EOF

Creating a Stub Header For Mips

cat > /usr/include/{{{1}}}.h << "EOF"
/* {{{1}}}.h - Stub Header  */
#ifndef __STUB__{{{1}}}_H__
#define __STUB__{{{1}}}_H__

#include <sgidefs.h>

#if (_MIPS_SIM == _ABIO32)
# include "{{{1}}}-32.h"
#elif (_MIPS_SIM == _ABIN32)
# include "{{{1}}}-n32.h"
#elif (_MIPS_SIM == _ABI64)
# include "{{{1}}}-64.h"
#endif

#endif /* __STUB__{{{1}}}_H__ */
EOF