/[MITgcm]/MITgcm_contrib/mpack_src/mpack-1.6-4/cmulocal/arx.m4
ViewVC logotype

Annotation of /MITgcm_contrib/mpack_src/mpack-1.6-4/cmulocal/arx.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sat Feb 23 20:13:30 2008 UTC (17 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
- get new version from: http://packages.qa.debian.org/m/mpack.html
  (files: mpack_1.6.orig.tar.gz, mpack_1.6-4.diff.gz, mpack_1.6-4.dsc)
  and apply patch 'mpack_1.6-4.diff' to original dir: mpack_1.6/
- this fix the MD5 coding on 64.bit platforms (well, seems to).
- added in Contrib to allow separate test (since building mpack seems fishy)

1 jmc 1.1 dnl $Id: arx.m4,v 1.4 2002/12/21 18:44:24 cg2v Exp $
2    
3     AC_DEFUN(CMU_ARX_INC_WHERE1, [
4     saved_CPPFLAGS=$CPPFLAGS
5     CPPFLAGS="$saved_CPPFLAGS -I$1"
6     AC_TRY_COMPILE([#include <arx.h>],
7     [arx_context *foo;],
8     ac_cv_found_arx_inc=yes,
9     ac_cv_found_arx_inc=no)
10     CPPFLAGS=$saved_CPPFLAGS
11     ])
12    
13     AC_DEFUN(CMU_ARX_INC_WHERE, [
14     for i in $1; do
15     AC_MSG_CHECKING(for arx headers in $i)
16     CMU_ARX_INC_WHERE1($i)
17     CMU_TEST_INCPATH($i, arx)
18     if test "$ac_cv_found_arx_inc" = "yes"; then
19     ac_cv_arx_where_inc=$i
20     AC_MSG_RESULT(found)
21     break
22     else
23     AC_MSG_RESULT(not found)
24     fi
25     done
26     ])
27    
28     #
29     # Test for lib files
30     #
31    
32     AC_DEFUN(CMU_ARX_LIB_WHERE1, [
33     AC_REQUIRE([CMU_AFS])
34     AC_REQUIRE([CMU_KRB4])
35     saved_LIBS=$LIBS
36     LIBS="$saved_LIBS -L$1 -larx $AFS_LIB_FLAGS $AFS_CLIENT_LIBS $KRB_LIB_FLAGS $LIB_SOCKET"
37     AC_TRY_LINK(,
38     [arx_Init();],
39     [ac_cv_found_arx_lib=yes],
40     ac_cv_found_arx_lib=no)
41     LIBS=$saved_LIBS
42     ])
43    
44     AC_DEFUN(CMU_ARX_LIB_WHERE, [
45     for i in $1; do
46     AC_MSG_CHECKING(for arx libraries in $i)
47     CMU_ARX_LIB_WHERE1($i)
48     CMU_TEST_LIBPATH($i, arx)
49     if test "$ac_cv_found_arx_lib" = "yes" ; then
50     ac_cv_arx_where_lib=$i
51     AC_MSG_RESULT(found)
52     break
53     else
54     AC_MSG_RESULT(not found)
55     fi
56     done
57     ])
58    
59     AC_DEFUN(CMU_USE_ARX, [
60     AC_ARG_WITH(arx,
61     [ --with-arx=PREFIX Compile with arx support],
62     [if test "X$with_arx" = "X"; then
63     with_arx=yes
64     fi])
65     AC_ARG_WITH(arx-lib,
66     [ --with-arx-lib=dir use arx libraries in dir],
67     [if test "$withval" = "yes" -o "$withval" = "no"; then
68     AC_MSG_ERROR([No argument for --with-arx-lib])
69     fi])
70     AC_ARG_WITH(arx-include,
71     [ --with-arx-include=dir use arx headers in dir],
72     [if test "$withval" = "yes" -o "$withval" = "no"; then
73     AC_MSG_ERROR([No argument for --with-arx-include])
74     fi])
75    
76     if test "X$with_arx" != "X"; then
77     if test "$with_arx" != "yes"; then
78     ac_cv_arx_where_lib=$with_arx/lib
79     ac_cv_arx_where_inc=$with_arx/include
80     fi
81     fi
82    
83     if test "X$with_arx_lib" != "X"; then
84     ac_cv_arx_where_lib=$with_arx_lib
85     fi
86     if test "X$ac_cv_arx_where_lib" = "X"; then
87     CMU_ARX_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
88     fi
89    
90     if test "X$with_arx_include" != "X"; then
91     ac_cv_arx_where_inc=$with_arx_include
92     fi
93     if test "X$ac_cv_arx_where_inc" = "X"; then
94     CMU_ARX_INC_WHERE(/usr/athena/include /usr/local/include)
95     fi
96    
97     AC_MSG_CHECKING(whether to include arx)
98     if test "X$ac_cv_arx_where_lib" = "X" -o "X$ac_cv_arx_where_inc" = "X"; then
99     ac_cv_found_arx=no
100     AC_MSG_RESULT(no)
101     else
102     ac_cv_found_arx=yes
103     AC_MSG_RESULT(yes)
104     ARX_INC_DIR=$ac_cv_arx_where_inc
105     ARX_LIB_DIR=$ac_cv_arx_where_lib
106     ARX_INC_FLAGS="-I${ARX_INC_DIR}"
107     ARX_LIB_FLAGS="-L${ARX_LIB_DIR} -larx"
108     ARX_LD_FLAGS="-L${ARX_LIB_DIR}"
109     dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
110     dnl Allow makefile substitutions....
111     AC_SUBST(ARX_INC_FLAGS)
112     AC_SUBST(ARX_LIB_FLAGS)
113     AC_SUBST(ARX_LD_FLAGS)
114     if test "X$RPATH" = "X"; then
115     RPATH=""
116     fi
117     case "${host}" in
118     *-*-linux*)
119     if test "X$RPATH" = "X"; then
120     RPATH="-Wl,-rpath,${ARX_LIB_DIR}"
121     else
122     RPATH="${RPATH}:${ARX_LIB_DIR}"
123     fi
124     ;;
125     *-*-hpux*)
126     if test "X$RPATH" = "X"; then
127     RPATH="-Wl,+b${ARX_LIB_DIR}"
128     else
129     RPATH="${RPATH}:${ARX_LIB_DIR}"
130     fi
131     ;;
132     *-*-irix*)
133     if test "X$RPATH" = "X"; then
134     RPATH="-Wl,-rpath,${ARX_LIB_DIR}"
135     else
136     RPATH="${RPATH}:${ARX_LIB_DIR}"
137     fi
138     ;;
139     *-*-solaris2*)
140     if test "$ac_cv_prog_gcc" = yes; then
141     if test "X$RPATH" = "X"; then
142     RPATH="-Wl,-R${ARX_LIB_DIR}"
143     else
144     RPATH="${RPATH}:${ARX_LIB_DIR}"
145     fi
146     else
147     RPATH="${RPATH} -R${ARX_LIB_DIR}"
148     fi
149     ;;
150     esac
151     AC_SUBST(RPATH)
152     fi
153     ])
154    

  ViewVC Help
Powered by ViewVC 1.1.22