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

Annotation of /MITgcm_contrib/mpack_src/mpack-1.6-4/cmulocal/com_err_link.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, 5 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 damnit, i don't want to figure out if I need to build an integral com_err
2     dnl library with the collection, I just want to know where it's installed,
3     dnl so don't bitch, Rob...
4     dnl Derrick Brashear
5     dnl $Id: com_err_link.m4,v 1.6 2002/12/21 18:44:24 cg2v Exp $
6    
7    
8     AC_DEFUN(CMU_COMERR_INC_WHERE1, [
9     saved_CPPFLAGS=$CPPFLAGS
10     CPPFLAGS="$saved_CPPFLAGS -I$1"
11     AC_TRY_COMPILE([#include <com_err.h>],
12     [int foo;],
13     ac_cv_found_com_err_inc=yes,
14     ac_cv_found_com_err_inc=no)
15     CPPFLAGS=$saved_CPPFLAGS
16     ])
17    
18     AC_DEFUN(CMU_COMERR_INC_WHERE, [
19     for i in $1; do
20     AC_MSG_CHECKING(for com_err headers in $i)
21     CMU_COMERR_INC_WHERE1($i)
22     CMU_TEST_INCPATH($i, com_err)
23     if test "$ac_cv_found_com_err_inc" = "yes"; then
24     ac_cv_comerr_where_inc=$i
25     AC_MSG_RESULT(found)
26     break
27     else
28     AC_MSG_RESULT(not found)
29     fi
30     done
31     ])
32    
33     #
34     # Test for lib files
35     #
36    
37     AC_DEFUN(CMU_COMERR_LIB_WHERE1, [
38     saved_LIBS=$LIBS
39     LIBS="$saved_LIBS -L$1 -lcom_err"
40     AC_TRY_LINK(,
41     [com_err();],
42     [ac_cv_found_com_err_lib=yes],
43     ac_cv_found_com_err_lib=no)
44     LIBS=$saved_LIBS
45     ])
46    
47     AC_DEFUN(CMU_COMERR_LIB_WHERE, [
48     for i in $1; do
49     AC_MSG_CHECKING(for com_err libraries in $i)
50     CMU_COMERR_LIB_WHERE1($i)
51     CMU_TEST_LIBPATH($i, com_err)
52     if test "$ac_cv_found_com_err_lib" = "yes" ; then
53     ac_cv_comerr_where_lib=$i
54     AC_MSG_RESULT(found)
55     break
56     else
57     AC_MSG_RESULT(not found)
58     fi
59     done
60     ])
61    
62     AC_DEFUN(CMU_USE_COMERR, [
63     AC_ARG_WITH(comerr,
64     [ --with-comerr=PREFIX Compile with com_err support],
65     [if test "X$with_comerr" = "X"; then
66     with_comerr=yes
67     fi])
68     AC_ARG_WITH(comerr-lib,
69     [ --with-comerr-lib=dir use com_err libraries in dir],
70     [if test "$withval" = "yes" -o "$withval" = "no"; then
71     AC_MSG_ERROR([No argument for --with-comerr-lib])
72     fi])
73     AC_ARG_WITH(comerr-include,
74     [ --with-comerr-include=dir use com_err headers in dir],
75     [if test "$withval" = "yes" -o "$withval" = "no"; then
76     AC_MSG_ERROR([No argument for --with-comerr-include])
77     fi])
78    
79     if test "X$with_comerr" != "X"; then
80     if test "$with_comerr" != "yes"; then
81     ac_cv_comerr_where_lib=$with_comerr/lib
82     ac_cv_comerr_where_inc=$with_comerr/include
83     fi
84     fi
85    
86     if test "X$with_comerr_lib" != "X"; then
87     ac_cv_comerr_where_lib=$with_comerr_lib
88     fi
89     if test "X$ac_cv_comerr_where_lib" = "X"; then
90     CMU_COMERR_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
91     fi
92    
93     if test "X$with_comerr_include" != "X"; then
94     ac_cv_comerr_where_inc=$with_comerr_include
95     fi
96     if test "X$ac_cv_comerr_where_inc" = "X"; then
97     CMU_COMERR_INC_WHERE(/usr/athena/include /usr/local/include)
98     fi
99    
100     AC_MSG_CHECKING(whether to include com_err)
101     if test "X$ac_cv_comerr_where_lib" = "X" -a "X$ac_cv_comerr_where_inc" = "X"; then
102     ac_cv_found_com_err=no
103     AC_MSG_RESULT(no)
104     else
105     ac_cv_found_com_err=yes
106     AC_MSG_RESULT(yes)
107     COMERR_INC_DIR=$ac_cv_comerr_where_inc
108     COMERR_LIB_DIR=$ac_cv_comerr_where_lib
109     COMERR_INC_FLAGS="-I${COMERR_INC_DIR}"
110     COMERR_LIB_FLAGS="-L${COMERR_LIB_DIR} -lcom_err"
111     dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
112     dnl Allow makefile substitutions....
113     AC_SUBST(COMERR_INC_FLAGS)
114     AC_SUBST(COMERR_LIB_FLAGS)
115     if test "X$RPATH" = "X"; then
116     RPATH=""
117     fi
118     case "${host}" in
119     *-*-linux*)
120     if test "X$RPATH" = "X"; then
121     RPATH="-Wl,-rpath,${COMERR_LIB_DIR}"
122     else
123     RPATH="${RPATH}:${COMERR_LIB_DIR}"
124     fi
125     ;;
126     *-*-hpux*)
127     if test "X$RPATH" = "X"; then
128     RPATH="-Wl,+b${COMERR_LIB_DIR}"
129     else
130     RPATH="${RPATH}:${COMERR_LIB_DIR}"
131     fi
132     ;;
133     *-*-irix*)
134     if test "X$RPATH" = "X"; then
135     RPATH="-Wl,-rpath,${COMERR_LIB_DIR}"
136     else
137     RPATH="${RPATH}:${COMERR_LIB_DIR}"
138     fi
139     ;;
140     *-*-solaris2*)
141     if test "$ac_cv_prog_gcc" = yes; then
142     if test "X$RPATH" = "X"; then
143     RPATH="-Wl,-R${COMERR_LIB_DIR}"
144     else
145     RPATH="${RPATH}:${COMERR_LIB_DIR}"
146     fi
147     else
148     RPATH="${RPATH} -R${COMERR_LIB_DIR}"
149     fi
150     ;;
151     esac
152     AC_SUBST(RPATH)
153     fi
154     ])

  ViewVC Help
Powered by ViewVC 1.1.22