Diff of /m4/dvdread.m4 [01797e] .. [ee1f59]  Maximize  Restore

Switch to unified view

a/m4/dvdread.m4 b/m4/dvdread.m4
1
dnl Configure paths for DVDNAV
1
dnl Configure paths for DVDREAD
2
dnl
2
dnl
3
dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr>
3
dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr>
4
dnl  
4
dnl  
5
dnl This program is free software; you can redistribute it and/or modify
5
dnl This program is free software; you can redistribute it and/or modify
6
dnl it under the terms of the GNU General Public License as published by
6
dnl it under the terms of the GNU General Public License as published by
...
...
21
dnl distribute this file as part of a program that contains a configuration
21
dnl distribute this file as part of a program that contains a configuration
22
dnl script generated by Autoconf, you may include it under the same
22
dnl script generated by Autoconf, you may include it under the same
23
dnl distribution terms that you use for the rest of that program.
23
dnl distribution terms that you use for the rest of that program.
24
dnl  
24
dnl  
25
25
26
dnl AM_PATH_DVDNAV([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
26
dnl AM_PATH_DVDREAD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
27
dnl Test for DVDNAV, and define DVDNAV_CFLAGS and DVDNAV_LIBS
27
dnl Test for DVDREAD, and define DVDREAD_CFLAGS and DVDREAD_LIBS
28
dnl
28
dnl
29
AC_DEFUN([AM_PATH_DVDNAV],
29
AC_DEFUN([AM_PATH_DVDREAD],
30
[dnl 
30
[dnl 
31
dnl Get the cflags and libraries from the dvdnav-config script
31
dnl Get the cflags and libraries from the dvdread-config script
32
dnl
32
dnl
33
AC_ARG_WITH(dvdnav-prefix,
33
AC_ARG_WITH(dvdread-prefix,
34
    AC_HELP_STRING([--with-dvdnav-prefix=DIR], [prefix where DVDNAV is installed (optional)]),
34
    AC_HELP_STRING([--with-dvdread-prefix=DIR], [prefix where DVDREAD is installed (optional)]),
35
            dvdnav_config_prefix="$withval", dvdnav_config_prefix="")
35
            dvdread_config_prefix="$withval", dvdread_config_prefix="")
36
AC_ARG_WITH(dvdnav-exec-prefix,
36
AC_ARG_WITH(dvdread-exec-prefix,
37
    AC_HELP_STRING([--with-dvdnav-exec-prefix=DIR], [exec prefix where DVDNAV is installed (optional)]),
37
    AC_HELP_STRING([--with-dvdread-exec-prefix=DIR], [exec prefix where DVDREAD is installed (optional)]),
38
            dvdnav_config_exec_prefix="$withval", dvdnav_config_exec_prefix="")
38
            dvdread_config_exec_prefix="$withval", dvdread_config_exec_prefix="")
39
AC_ARG_ENABLE(dvdnavtest, 
39
AC_ARG_ENABLE(dvdreadtest, 
40
    AC_HELP_STRING([--disable-dvdnavtest], [do not try to compile and run a test DVDNAV program]),
40
    AC_HELP_STRING([--disable-dvdreadtest], [do not try to compile and run a test DVDREAD program]),
41
            enable_dvdnavtest=$enableval, enable_dvdnavtest=yes)
41
            enable_dvdreadtest=$enableval, enable_dvdreadtest=yes)
42
42
43
  if test x$dvdnav_config_exec_prefix != x ; then
43
  if test x$dvdread_config_exec_prefix != x ; then
44
     dvdnav_config_args="$dvdnav_config_args --exec-prefix=$dvdnav_config_exec_prefix"
44
     dvdread_config_args="$dvdread_config_args --exec-prefix=$dvdread_config_exec_prefix"
45
     if test x${DVDNAV_CONFIG+set} != xset ; then
45
     if test x${DVDREAD_CONFIG+set} != xset ; then
46
        DVDNAV_CONFIG=$dvdnav_config_exec_prefix/bin/dvdnav-config
46
        DVDREAD_CONFIG=$dvdread_config_exec_prefix/bin/dvdread-config
47
     fi
47
     fi
48
  fi
48
  fi
49
  if test x$dvdnav_config_prefix != x ; then
49
  if test x$dvdread_config_prefix != x ; then
50
     dvdnav_config_args="$dvdnav_config_args --prefix=$dvdnav_config_prefix"
50
     dvdread_config_args="$dvdread_config_args --prefix=$dvdread_config_prefix"
51
     if test x${DVDNAV_CONFIG+set} != xset ; then
51
     if test x${DVDREAD_CONFIG+set} != xset ; then
52
        DVDNAV_CONFIG=$dvdnav_config_prefix/bin/dvdnav-config
52
        DVDREAD_CONFIG=$dvdread_config_prefix/bin/dvdread-config
53
     fi
53
     fi
54
  fi
54
  fi
55
55
56
  min_dvdnav_version=ifelse([$1], ,0.0.0,$1)
56
  min_dvdread_version=ifelse([$1], ,0.0.0,$1)
57
  if test "x$enable_dvdnavtest" != "xyes" ; then
57
  if test "x$enable_dvdreadtest" != "xyes" ; then
58
    AC_MSG_CHECKING([for DVDNAV-LIB version >= $min_dvdnav_version])
58
    AC_MSG_CHECKING([for DVDREAD-LIB version >= $min_dvdread_version])
59
  else
59
  else
60
    AC_PATH_PROG(DVDNAV_CONFIG, dvdnav-config, no)
60
    AC_PATH_PROG(DVDREAD_CONFIG, dvdread-config, no)
61
    AC_MSG_CHECKING([for DVDNAV-LIB version >= $min_dvdnav_version])
61
    AC_MSG_CHECKING([for DVDREAD-LIB version >= $min_dvdread_version])
62
    no_dvdnav=""
62
    no_dvdread=""
63
    if test "$DVDNAV_CONFIG" = "no" ; then
63
    if test "$DVDREAD_CONFIG" = "no" ; then
64
      no_dvdnav=yes
64
      no_dvdread=yes
65
    else
65
    else
66
      DVDNAV_CFLAGS=`$DVDNAV_CONFIG $dvdnav_config_args --cflags`
66
      DVDREAD_CFLAGS=`$DVDREAD_CONFIG $dvdread_config_args --cflags`
67
      DVDNAV_LIBS=`$DVDNAV_CONFIG $dvdnav_config_args --libs`
67
      DVDREAD_LIBS=`$DVDREAD_CONFIG $dvdread_config_args --libs`
68
      dvdnav_config_major_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \
68
      dvdread_config_major_version=`$DVDREAD_CONFIG $dvdread_config_args --version | \
69
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
69
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
70
      dvdnav_config_minor_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \
70
      dvdread_config_minor_version=`$DVDREAD_CONFIG $dvdread_config_args --version | \
71
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
71
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
72
      dvdnav_config_sub_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \
72
      dvdread_config_sub_version=`$DVDREAD_CONFIG $dvdread_config_args --version | \
73
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
73
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
74
      dnl    if test "x$enable_dvdnavtest" = "xyes" ; then
74
      dnl    if test "x$enable_dvdreadtest" = "xyes" ; then
75
      ac_save_CFLAGS="$CFLAGS"
75
      ac_save_CFLAGS="$CFLAGS"
76
      ac_save_LIBS="$LIBS"
76
      ac_save_LIBS="$LIBS"
77
      CFLAGS="$CFLAGS $DVDNAV_CFLAGS"
77
      CFLAGS="$CFLAGS $DVDREAD_CFLAGS"
78
      LIBS="$DVDNAV_LIBS $LIBS"
78
      LIBS="$DVDREAD_LIBS $LIBS"
79
dnl
79
dnl
80
dnl Now check if the installed DVDNAV is sufficiently new. (Also sanity
80
dnl Now check if the installed DVDREAD is sufficiently new. (Also sanity
81
dnl checks the results of dvdnav-config to some extent
81
dnl checks the results of dvdread-config to some extent
82
dnl
82
dnl
83
      AC_LANG_SAVE()
83
      AC_LANG_SAVE()
84
      AC_LANG_C()
84
      AC_LANG_C()
85
      rm -f conf.dvdnavtest
85
      rm -f conf.dvdreadtest
86
      AC_TRY_RUN([
86
      AC_TRY_RUN([
87
#include <dvdnav.h>
87
#include <dvdread.h>
88
#include <stdio.h>
88
#include <stdio.h>
89
#include <stdlib.h>
89
#include <stdlib.h>
90
#include <string.h>
90
#include <string.h>
91
91
92
int 
92
int 
93
main ()
93
main ()
94
{
94
{
95
  int major, minor, sub;
95
  int major, minor, sub;
96
   char *tmp_version;
96
   char *tmp_version;
97
97
98
  system ("touch conf.dvdnavtest");
98
  system ("touch conf.dvdreadtest");
99
99
100
  /* HP/UX 9 (%@#!) writes to sscanf strings */
100
  /* HP/UX 9 (%@#!) writes to sscanf strings */
101
  tmp_version = (char *) strdup("$min_dvdnav_version");
101
  tmp_version = (char *) strdup("$min_dvdread_version");
102
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) {
102
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) {
103
     printf("%s, bad version string\n", "$min_dvdnav_version");
103
     printf("%s, bad version string\n", "$min_dvdread_version");
104
     exit(1);
104
     exit(1);
105
   }
105
   }
106
106
107
  if (($dvdnav_config_major_version > major) ||
107
  if (($dvdread_config_major_version > major) ||
108
     (($dvdnav_config_major_version == major) && ($dvdnav_config_minor_version > minor)) ||
108
     (($dvdread_config_major_version == major) && ($dvdread_config_minor_version > minor)) ||
109
     (($dvdnav_config_major_version == major) && ($dvdnav_config_minor_version == minor) && ($dvdnav_config_sub_version >= sub))) {
109
     (($dvdread_config_major_version == major) && ($dvdread_config_minor_version == minor) && ($dvdread_config_sub_version >= sub))) {
110
    return 0;
110
    return 0;
111
  } else {
111
  } else {
112
    printf("\n*** An old version of libdvdnav (%d.%d.%d) was found.\n",
112
    printf("\n*** An old version of libdvdread (%d.%d.%d) was found.\n",
113
      $dvdnav_config_major_version, $dvdnav_config_minor_version, $dvdnav_config_sub_version);
113
      $dvdread_config_major_version, $dvdread_config_minor_version, $dvdread_config_sub_version);
114
    printf("*** You need a version of libdvdnav newer than %d.%d.%d. The latest version of\n",
114
    printf("*** You need a version of libdvdread newer than %d.%d.%d. The latest version of\n",
115
      major, minor, sub);
115
      major, minor, sub);
116
    printf("*** libdvdnav is always available from:\n");
116
    printf("*** libdvdread is always available from:\n");
117
    printf("***        http://dvd.sourceforge.net\n");
117
    printf("***        http://dvd.sourceforge.net\n");
118
    printf("***\n");
118
    printf("***\n");
119
    printf("*** If you have already installed a sufficiently new version, this error\n");
119
    printf("*** If you have already installed a sufficiently new version, this error\n");
120
    printf("*** probably means that the wrong copy of the dvdnav-config shell script is\n");
120
    printf("*** probably means that the wrong copy of the dvdread-config shell script is\n");
121
    printf("*** being found. The easiest way to fix this is to remove the old version\n");
121
    printf("*** being found. The easiest way to fix this is to remove the old version\n");
122
    printf("*** of libdvdnav, but you can also set the DVDNAV_CONFIG environment to point to the\n");
122
    printf("*** of libdvdread, but you can also set the DVDREAD_CONFIG environment to point to the\n");
123
    printf("*** correct copy of dvdnav-config. (In this case, you will have to\n");
123
    printf("*** correct copy of dvdread-config. (In this case, you will have to\n");
124
    printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
124
    printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
125
    printf("*** so that the correct libraries are found at run-time))\n");
125
    printf("*** so that the correct libraries are found at run-time))\n");
126
  }
126
  }
127
  return 1;
127
  return 1;
128
}
128
}
129
],, no_dvdnav=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
129
],, no_dvdread=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
130
       CFLAGS="$ac_save_CFLAGS"
130
       CFLAGS="$ac_save_CFLAGS"
131
       LIBS="$ac_save_LIBS"
131
       LIBS="$ac_save_LIBS"
132
     fi
132
     fi
133
    fi
133
    fi
134
    if test "x$no_dvdnav" = x ; then
134
    if test "x$no_dvdread" = x ; then
135
       AC_MSG_RESULT(yes)
135
       AC_MSG_RESULT(yes)
136
       ifelse([$2], , :, [$2])     
136
       ifelse([$2], , :, [$2])     
137
    else
137
    else
138
      AC_MSG_RESULT(no)
138
      AC_MSG_RESULT(no)
139
      if test "$DVDNAV_CONFIG" = "no" ; then
139
      if test "$DVDREAD_CONFIG" = "no" ; then
140
        echo "*** The dvdnav-config script installed by DVDNAV could not be found"
140
        echo "*** The dvdread-config script installed by DVDREAD could not be found"
141
        echo "*** If DVDNAV was installed in PREFIX, make sure PREFIX/bin is in"
141
        echo "*** If DVDREAD was installed in PREFIX, make sure PREFIX/bin is in"
142
        echo "*** your path, or set the DVDNAV_CONFIG environment variable to the"
142
        echo "*** your path, or set the DVDREAD_CONFIG environment variable to the"
143
        echo "*** full path to dvdnav-config."
143
        echo "*** full path to dvdread-config."
144
      else
144
      else
145
        if test -f conf.dvdnavtest ; then
145
        if test -f conf.dvdreadtest ; then
146
          :
146
          :
147
        else
147
        else
148
          echo "*** Could not run DVDNAV test program, checking why..."
148
          echo "*** Could not run DVDREAD test program, checking why..."
149
          CFLAGS="$CFLAGS $DVDNAV_CFLAGS"
149
          CFLAGS="$CFLAGS $DVDREAD_CFLAGS"
150
          LIBS="$LIBS $DVDNAV_LIBS"
150
          LIBS="$LIBS $DVDREAD_LIBS"
151
          AC_TRY_LINK([
151
          AC_TRY_LINK([
152
#include <dvdnav.h>
152
#include <dvdread.h>
153
#include <stdio.h>
153
#include <stdio.h>
154
],      [ return 0; ],
154
],      [ return 0; ],
155
        [ echo "*** The test program compiled, but did not run. This usually means"
155
        [ echo "*** The test program compiled, but did not run. This usually means"
156
          echo "*** that the run-time linker is not finding DVDNAV or finding the wrong"
156
          echo "*** that the run-time linker is not finding DVDREAD or finding the wrong"
157
          echo "*** version of DVDNAV. If it is not finding DVDNAV, you'll need to set your"
157
          echo "*** version of DVDREAD. If it is not finding DVDREAD, you'll need to set your"
158
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
158
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
159
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
159
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
160
          echo "*** is required on your system"
160
          echo "*** is required on your system"
161
      echo "***"
161
      echo "***"
162
          echo "*** If you have an old version installed, it is best to remove it, although"
162
          echo "*** If you have an old version installed, it is best to remove it, although"
163
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
163
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
164
          echo "***"],
164
          echo "***"],
165
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
165
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
166
          echo "*** exact error that occured. This usually means DVDNAV was incorrectly installed"
166
          echo "*** exact error that occured. This usually means DVDREAD was incorrectly installed"
167
          echo "*** or that you have moved DVDNAV since it was installed. In the latter case, you"
167
          echo "*** or that you have moved DVDREAD since it was installed. In the latter case, you"
168
          echo "*** may want to edit the dvdnav-config script: $DVDNAV_CONFIG" ])
168
          echo "*** may want to edit the dvdread-config script: $DVDREAD_CONFIG" ])
169
          CFLAGS="$ac_save_CFLAGS"
169
          CFLAGS="$ac_save_CFLAGS"
170
          LIBS="$ac_save_LIBS"
170
          LIBS="$ac_save_LIBS"
171
        fi
171
        fi
172
      fi
172
      fi
173
    DVDNAV_CFLAGS=""
173
    DVDREAD_CFLAGS=""
174
    DVDNAV_LIBS=""
174
    DVDREAD_LIBS=""
175
    ifelse([$3], , :, [$3])
175
    ifelse([$3], , :, [$3])
176
  fi
176
  fi
177
  AC_SUBST(DVDNAV_CFLAGS)
177
  AC_SUBST(DVDREAD_CFLAGS)
178
  AC_SUBST(DVDNAV_LIBS)
178
  AC_SUBST(DVDREAD_LIBS)
179
  AC_LANG_RESTORE()
179
  AC_LANG_RESTORE()
180
  rm -f conf.dvdnavtest
180
  rm -f conf.dvdreadtest
181
])
181
])

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks