~ubuntu-branches/ubuntu/feisty/soqt/feisty

« back to all changes in this revision

Viewing changes to cfg/m4/sowin.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-05-29 02:58:50 UTC
  • Revision ID: james.westby@ubuntu.com-20040529025850-nkh0l2b0mixwkcgh
Tags: 1.0.2-3
Build against coin-2, rather than coin-1.  Closes: #241102.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############################################################################
 
2
# Usage:
 
3
#   SIM_AC_HAVE_SOWIN_IFELSE( IF-FOUND, IF-NOT-FOUND )
 
4
#
 
5
# Description:
 
6
#   This macro locates the SoWin development system.  If it is found,
 
7
#   the set of variables listed below are set up as described and made
 
8
#   available to the configure script.
 
9
#
 
10
#   The $sim_ac_sowin_desired variable can be set to false externally to
 
11
#   make SoWin default to be excluded.
 
12
#
 
13
# Autoconf Variables:
 
14
# > $sim_ac_sowin_desired     true | false (defaults to true)
 
15
# < $sim_ac_sowin_avail       true | false
 
16
# < $sim_ac_sowin_cppflags    (extra flags the preprocessor needs)
 
17
# < $sim_ac_sowin_ldflags     (extra flags the linker needs)
 
18
# < $sim_ac_sowin_libs        (link library flags the linker needs)
 
19
# < $sim_ac_sowin_datadir     (location of SoWin data files)
 
20
# < $sim_ac_sowin_version     (the libSoWin version)
 
21
#
 
22
# Authors:
 
23
#   Lars J. Aas, <larsa@sim.no>
 
24
#   Morten Eriksen, <mortene@sim.no>
 
25
#
 
26
# TODO:
 
27
#
 
28
 
 
29
AC_DEFUN([SIM_AC_HAVE_SOWIN_IFELSE], [
 
30
AC_PREREQ([2.14a])
 
31
 
 
32
# official variables
 
33
sim_ac_sowin_avail=false
 
34
sim_ac_sowin_cppflags=
 
35
sim_ac_sowin_ldflags=
 
36
sim_ac_sowin_libs=
 
37
sim_ac_sowin_datadir=
 
38
sim_ac_sowin_version=
 
39
 
 
40
# internal variables
 
41
: ${sim_ac_sowin_desired=true}
 
42
sim_ac_sowin_extrapath=
 
43
 
 
44
AC_ARG_WITH([sowin], AC_HELP_STRING([--without-sowin], [disable use of SoWin]))
 
45
AC_ARG_WITH([sowin], AC_HELP_STRING([--with-sowin], [enable use of SoWin]))
 
46
AC_ARG_WITH([sowin],
 
47
  AC_HELP_STRING([--with-sowin=DIR], [give prefix location of SoWin]),
 
48
  [ case $withval in
 
49
    no)  sim_ac_sowin_desired=false ;;
 
50
    yes) sim_ac_sowin_desired=true ;;
 
51
    *)   sim_ac_sowin_desired=true
 
52
         sim_ac_sowin_extrapath=$withval ;;
 
53
    esac],
 
54
  [])
 
55
 
 
56
if $sim_ac_sowin_desired; then
 
57
  sim_ac_path=$PATH
 
58
  test -z "$sim_ac_sowin_extrapath" ||   ## search in --with-sowin path
 
59
    sim_ac_path=$sim_ac_sowin_extrapath/bin:$sim_ac_path
 
60
  test x"$prefix" = xNONE ||          ## search in --prefix path
 
61
    sim_ac_path=$sim_ac_path:$prefix/bin
 
62
 
 
63
  AC_PATH_PROG(sim_ac_sowin_configcmd, sowin-config, false, $sim_ac_path)
 
64
  if $sim_ac_sowin_configcmd; then
 
65
    sim_ac_sowin_cppflags=`$sim_ac_sowin_configcmd --cppflags`
 
66
    sim_ac_sowin_ldflags=`$sim_ac_sowin_configcmd --ldflags`
 
67
    sim_ac_sowin_libs=`$sim_ac_sowin_configcmd --libs`
 
68
    sim_ac_sowin_datadir=`$sim_ac_sowin_configcmd --datadir`
 
69
    sim_ac_sowin_version=`$sim_ac_sowin_configcmd --version`
 
70
    AC_CACHE_CHECK(
 
71
      [whether libSoWin is available],
 
72
      sim_cv_sowin_avail,
 
73
      [sim_ac_save_cppflags=$CPPFLAGS
 
74
      sim_ac_save_ldflags=$LDFLAGS
 
75
      sim_ac_save_libs=$LIBS
 
76
      CPPFLAGS="$CPPFLAGS $sim_ac_sowin_cppflags"
 
77
      LDFLAGS="$LDFLAGS $sim_ac_sowin_ldflags"
 
78
      LIBS="$sim_ac_sowin_libs $LIBS"
 
79
      AC_LANG_PUSH(C++)
 
80
      AC_TRY_LINK(
 
81
        [#include <Inventor/Win/SoWin.h>],
 
82
        [(void)SoWin::init((const char *)0L);],
 
83
        [sim_cv_sowin_avail=true],
 
84
        [sim_cv_sowin_avail=false])
 
85
      AC_LANG_POP
 
86
      CPPFLAGS=$sim_ac_save_cppflags
 
87
      LDFLAGS=$sim_ac_save_ldflags
 
88
      LIBS=$sim_ac_save_libs
 
89
    ])
 
90
    sim_ac_sowin_avail=$sim_cv_sowin_avail
 
91
  else
 
92
    locations=`IFS=:; for p in $sim_ac_path; do echo " -> $p/sowin-config"; done`
 
93
    AC_MSG_WARN([cannot find 'sowin-config' at any of these locations:
 
94
$locations])
 
95
  fi
 
96
fi
 
97
 
 
98
if $sim_ac_sowin_avail; then
 
99
  ifelse([$1], , :, [$1])
 
100
else
 
101
  ifelse([$2], , :, [$2])
 
102
fi
 
103
]) # SIM_AC_HAVE_SOWIN_IFELSE()
 
104