| Last change
 on this file since 242 was             92, checked in by cinc, 19 years ago | 
        
          | 
Orbit2 modified for use with NOM
 | 
        
          | File size:
            1.2 KB | 
      
      
| Line |  | 
|---|
| 1 | ####################### | 
|---|
| 2 | # type alignment test # | 
|---|
| 3 | ####################### | 
|---|
| 4 |  | 
|---|
| 5 | AC_DEFUN([AC_CHECK_ALIGNOF], | 
|---|
| 6 | [changequote(<<, >>)dnl | 
|---|
| 7 | dnl The name to #define. | 
|---|
| 8 | define(<<AC_TYPE_NAME>>, | 
|---|
| 9 | translit(orbit_alignof_$1, [a-z *], [A-Z_P]))dnl | 
|---|
| 10 | dnl The cache variable name. | 
|---|
| 11 | define(<<AC_CV_NAME>>, | 
|---|
| 12 | translit(ac_cv_alignof_$1, [ *], [_p]))dnl | 
|---|
| 13 | changequote([, ])dnl | 
|---|
| 14 | AC_MSG_CHECKING(alignment of $1) | 
|---|
| 15 | align_save_libs="$LIBS" | 
|---|
| 16 | LIBS="$ORBIT_LIBS $LIBS" | 
|---|
| 17 | AC_CACHE_VAL(AC_CV_NAME, | 
|---|
| 18 | [AC_TRY_RUN( | 
|---|
| 19 | [ #include <stdio.h> | 
|---|
| 20 | #include <stdlib.h> | 
|---|
| 21 |  | 
|---|
| 22 | #include "$srcdir/include/orbit/util/basic_types.h" | 
|---|
| 23 | typedef struct {char s1;} CORBA_struct; | 
|---|
| 24 | typedef void *CORBA_pointer; | 
|---|
| 25 | struct test {char s1; $1 s2;}; | 
|---|
| 26 | main() | 
|---|
| 27 | { | 
|---|
| 28 | FILE *f=fopen("conftestval", "w"); | 
|---|
| 29 | if (!f) exit(1); | 
|---|
| 30 | fprintf(f, "%d\n", &(((struct test*)0)->s2)); | 
|---|
| 31 | exit(0); | 
|---|
| 32 | } ], | 
|---|
| 33 | AC_CV_NAME=`cat conftestval`, | 
|---|
| 34 | AC_CV_NAME=0, AC_CV_NAME=0) | 
|---|
| 35 | ])dnl | 
|---|
| 36 | AC_MSG_RESULT($AC_CV_NAME) | 
|---|
| 37 | if test "$AC_CV_NAME" = "0" ; then | 
|---|
| 38 | AC_MSG_ERROR([Failed to find alignment. Check config.log for details.]) | 
|---|
| 39 | fi | 
|---|
| 40 | LIBS="$align_save_libs" | 
|---|
| 41 | AC_TYPE_NAME=$AC_CV_NAME | 
|---|
| 42 | AC_SUBST(AC_TYPE_NAME) | 
|---|
| 43 | undefine([AC_TYPE_NAME])dnl | 
|---|
| 44 | undefine([AC_CV_NAME])dnl | 
|---|
| 45 | ]) | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.