Ticket #24397: smpeg-autotools-fixed.diff

File smpeg-autotools-fixed.diff, 31.9 KB (added by raimue (Rainer Müller), 14 years ago)

Large diff containing changes for Portfile and files

  • files/patch-configure-flags.diff

     
     1--- configure.in.orig
     2+++ configure.in
     3@@ -60,7 +60,7 @@ dnl The alpha architecture needs special
     4 case "$target" in
     5     alpha*-*-linux*)
     6        if test x$ac_cv_prog_gcc = xyes; then
     7-            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
     8+            EXTRA_CFLAGS="$EXTRA_CFLAGS -mcpu=ev4 -Wa,-mall"
     9         fi
     10         ;;
     11     sparc*-*-solaris*)
     12@@ -102,17 +102,17 @@ AC_ARG_ENABLE(debug,
     13               , enable_debug=yes)
     14 if test x$enable_debug != xyes; then
     15     if test x$ac_cv_prog_gcc = xyes; then
     16-        CFLAGS="$CFLAGS -fexpensive-optimizations -fomit-frame-pointer"
     17+        EXTRA_CFLAGS="$EXTRA_CFLAGS -fexpensive-optimizations -fomit-frame-pointer"
     18     fi
     19     case "$target" in
     20         i486-*-*)  # Yeah right. :)
     21             if test x$ac_cv_prog_gcc = xyes; then
     22-                CFLAGS="$CFLAGS -march=486"
     23+                EXTRA_CFLAGS="$EXTRA_CFLAGS -march=486"
     24             fi
     25             ;;
     26         i?86-*-*)
     27             if test x$ac_cv_prog_gcc = xyes; then
     28-                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
     29+                EXTRA_CFLAGS="$EXTRA_CFLAGS -march=pentium -mcpu=pentiumpro"
     30             fi
     31             ;;
     32     esac
     33@@ -124,7 +124,7 @@ AM_PATH_SDL($SDL_VERSION,
     34             :,
     35            AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
     36 )
     37-CFLAGS="$CFLAGS $SDL_CFLAGS"
     38+EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
     39 LIBS="$LIBS $SDL_LIBS"
     40 
     41 dnl See if we need to pass -lm for the math library
     42@@ -145,7 +145,7 @@ if test x$enable_mmx = xyes; then
     43     AC_MSG_RESULT($use_mmx)
     44 
     45     if test x$use_mmx = xyes; then
     46-        CFLAGS="$CFLAGS -DUSE_MMX"
     47+        EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_MMX"
     48     fi
     49 fi
     50 
     51@@ -162,7 +162,7 @@ if test x$enable_ati = xyes; then
     52     AC_MSG_RESULT($use_ati)
     53 
     54     if test x$use_ati = xyes; then
     55-        CFLAGS="$CFLAGS -DUSE_ATI"
     56+       EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_ATI"
     57     fi
     58 fi
     59 
     60@@ -171,7 +171,7 @@ AC_ARG_ENABLE(timestamp-sync,
     61 [  --enable-timestamp-sync  enable system timestamp sync [default=yes]],
     62               , enable_timestamp_sync=no)
     63 if test x$enable_timestamp_sync = xyes; then
     64-       CFLAGS="$CFLAGS -DUSE_TIMESTAMP_SYNC"
     65+EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMESTAMP_SYNC"
     66 fi
     67 
     68 dnl Enable the use of the system thread
     69@@ -179,7 +179,7 @@ AC_ARG_ENABLE(threaded-system,
     70 [  --enable-threaded-system enable system thread         [default=no]],
     71               , enable_threaded_system=no)
     72 if test x$enable_threaded_system = xyes; then
     73-       CFLAGS="$CFLAGS -DUSE_SYSTEM_THREAD"
     74+EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_SYSTEM_THREAD"
     75 fi
     76 
     77 dnl Enable threaded audio
     78@@ -187,7 +187,7 @@ AC_ARG_ENABLE(threaded-audio,
     79 [  --enable-threaded-audio  enable threaded audio        [default=yes]],
     80               , enable_threaded_audio=yes)
     81 if test x$enable_threaded_audio = xyes; then
     82-       CFLAGS="$CFLAGS -DTHREADED_AUDIO"
     83+EXTRA_CFLAGS="$EXTRA_CFLAGS -DTHREADED_AUDIO"
     84 fi
     85 
     86 dnl See if we can build the GTk player
     87@@ -198,7 +198,7 @@ have_gtk=no
     88 if test x$enable_gtk_player = xyes; then
     89     AM_PATH_GTK(1.2.1, have_gtk=yes)
     90     if test x$have_gtk = xyes; then
     91-        CFLAGS="$CFLAGS $GTK_CFLAGS"
     92+       EXTRA_CFLAGS="$EXTRA_CFLAGS $GTK_CFLAGS"
     93     fi
     94     AC_SUBST(GTK_LIBS)
     95 fi
     96@@ -224,7 +224,7 @@ if test x$enable_opengl_player = xyes; t
     97             AC_PATH_X
     98             AC_PATH_XTRA
     99             if test x$have_x = xyes; then
     100-                CFLAGS="$CFLAGS $X_CFLAGS"
     101+               EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
     102                 SYS_GL_LIBS="$X_LIBS -lGL -lGLU"
     103             else
     104                 SYS_GL_LIBS="-lGL -lGLU"
     105@@ -255,17 +255,16 @@ AC_ARG_ENABLE(assertions,
     106 [  --enable-assertions     Enable consistency checks in decoding [default=no]],
     107               , enable_assertions=no)
     108 if test x$enable_assertions != xyes; then
     109-    CFLAGS="$CFLAGS -DNDEBUG"
     110+   EXTRA_CFLAGS="$EXTRA_CFLAGS -DNDEBUG"
     111 fi
     112 
     113 dnl Add the source include directories
     114-CFLAGS="$CFLAGS -I.. -DNOCONTROLS"
     115-CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/audio -I\$(top_srcdir)/video"
     116-CXXFLAGS="$CFLAGS"
     117-
     118+EXTRA_CFLAGS="$EXTRA_CFLAGS -I.. -DNOCONTROLS"
     119+EXTRA_CFLAGS="$EXTRA_CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/audio -I\$(top_srcdir)/video"
     120+CXXFLAGS="$EXTRA_CFLAGS $CXXFLAGS"
     121+CFLAGS="$EXTRA_CFLAGS $CFLAGS"
     122 
     123 dnl C++ flags are the same as the C flags
     124-CXXFLAGS="$CFLAGS"
     125 if test x$GCC = xyes; then
     126     # Check to see if options -fno-rtti -fno-exceptions are supported
     127     AC_MSG_CHECKING(if $CXX supports -fno-rtti -fno-exceptions)
  • files/patch-smpeg-gtkm4.diff

     
     1Taken from http://bugs.gentoo.org/127866
     2Index: m4/glib.m4
     3===================================================================
     4--- /dev/null
     5+++ m4/glib.m4
     6@@ -0,0 +1,196 @@
     7+# Configure paths for GLIB
     8+# Owen Taylor     97-11-3
     9+
     10+dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
     11+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
     12+dnl gthread is specified in MODULES, pass to glib-config
     13+dnl
     14+AC_DEFUN([AM_PATH_GLIB],
     15+[dnl
     16+dnl Get the cflags and libraries from the glib-config script
     17+dnl
     18+AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
     19+            glib_config_prefix="$withval", glib_config_prefix="")
     20+AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
     21+            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
     22+AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
     23+                   , enable_glibtest=yes)
     24+
     25+  if test x$glib_config_exec_prefix != x ; then
     26+     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
     27+     if test x${GLIB_CONFIG+set} != xset ; then
     28+        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
     29+     fi
     30+  fi
     31+  if test x$glib_config_prefix != x ; then
     32+     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
     33+     if test x${GLIB_CONFIG+set} != xset ; then
     34+        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
     35+     fi
     36+  fi
     37+
     38+  for module in . $4
     39+  do
     40+      case "$module" in
     41+         gmodule)
     42+             glib_config_args="$glib_config_args gmodule"
     43+         ;;
     44+         gthread)
     45+             glib_config_args="$glib_config_args gthread"
     46+         ;;
     47+      esac
     48+  done
     49+
     50+  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
     51+  min_glib_version=ifelse([$1], ,0.99.7,$1)
     52+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
     53+  no_glib=""
     54+  if test "$GLIB_CONFIG" = "no" ; then
     55+    no_glib=yes
     56+  else
     57+    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
     58+    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
     59+    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
     60+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     61+    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
     62+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     63+    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
     64+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     65+    if test "x$enable_glibtest" = "xyes" ; then
     66+      ac_save_CFLAGS="$CFLAGS"
     67+      ac_save_LIBS="$LIBS"
     68+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
     69+      LIBS="$GLIB_LIBS $LIBS"
     70+dnl
     71+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
     72+dnl checks the results of glib-config to some extent
     73+dnl
     74+      rm -f conf.glibtest
     75+      AC_TRY_RUN([
     76+#include <glib.h>
     77+#include <stdio.h>
     78+#include <stdlib.h>
     79+
     80+int
     81+main ()
     82+{
     83+  int major, minor, micro;
     84+  char *tmp_version;
     85+
     86+  system ("touch conf.glibtest");
     87+
     88+  /* HP/UX 9 (%@#!) writes to sscanf strings */
     89+  tmp_version = g_strdup("$min_glib_version");
     90+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
     91+     printf("%s, bad version string\n", "$min_glib_version");
     92+     exit(1);
     93+   }
     94+
     95+  if ((glib_major_version != $glib_config_major_version) ||
     96+      (glib_minor_version != $glib_config_minor_version) ||
     97+      (glib_micro_version != $glib_config_micro_version))
     98+    {
     99+      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
     100+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
     101+             glib_major_version, glib_minor_version, glib_micro_version);
     102+      printf ("*** was found! If glib-config was correct, then it is best\n");
     103+      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
     104+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
     105+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
     106+      printf("*** required on your system.\n");
     107+      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
     108+      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
     109+      printf("*** before re-running configure\n");
     110+    }
     111+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
     112+          (glib_minor_version != GLIB_MINOR_VERSION) ||
     113+           (glib_micro_version != GLIB_MICRO_VERSION))
     114+    {
     115+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
     116+            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
     117+      printf("*** library (version %d.%d.%d)\n",
     118+            glib_major_version, glib_minor_version, glib_micro_version);
     119+    }
     120+  else
     121+    {
     122+      if ((glib_major_version > major) ||
     123+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
     124+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
     125+      {
     126+        return 0;
     127+       }
     128+     else
     129+      {
     130+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
     131+               glib_major_version, glib_minor_version, glib_micro_version);
     132+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
     133+              major, minor, micro);
     134+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
     135+        printf("***\n");
     136+        printf("*** If you have already installed a sufficiently new version, this error\n");
     137+        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
     138+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
     139+        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
     140+        printf("*** correct copy of glib-config. (In this case, you will have to\n");
     141+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
     142+        printf("*** so that the correct libraries are found at run-time))\n");
     143+      }
     144+    }
     145+  return 1;
     146+}
     147+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
     148+       CFLAGS="$ac_save_CFLAGS"
     149+       LIBS="$ac_save_LIBS"
     150+     fi
     151+  fi
     152+  if test "x$no_glib" = x ; then
     153+     AC_MSG_RESULT(yes)
     154+     ifelse([$2], , :, [$2])     
     155+  else
     156+     AC_MSG_RESULT(no)
     157+     if test "$GLIB_CONFIG" = "no" ; then
     158+       echo "*** The glib-config script installed by GLIB could not be found"
     159+       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
     160+       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
     161+       echo "*** full path to glib-config."
     162+     else
     163+       if test -f conf.glibtest ; then
     164+        :
     165+       else
     166+          echo "*** Could not run GLIB test program, checking why..."
     167+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
     168+          LIBS="$LIBS $GLIB_LIBS"
     169+          AC_TRY_LINK([
     170+#include <glib.h>
     171+#include <stdio.h>
     172+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
     173+        [ echo "*** The test program compiled, but did not run. This usually means"
     174+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
     175+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
     176+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
     177+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
     178+          echo "*** is required on your system"
     179+         echo "***"
     180+          echo "*** If you have an old version installed, it is best to remove it, although"
     181+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
     182+          echo "***"
     183+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
     184+          echo "*** came with the system with the command"
     185+          echo "***"
     186+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
     187+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
     188+          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
     189+          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
     190+          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
     191+          CFLAGS="$ac_save_CFLAGS"
     192+          LIBS="$ac_save_LIBS"
     193+       fi
     194+     fi
     195+     GLIB_CFLAGS=""
     196+     GLIB_LIBS=""
     197+     ifelse([$3], , :, [$3])
     198+  fi
     199+  AC_SUBST(GLIB_CFLAGS)
     200+  AC_SUBST(GLIB_LIBS)
     201+  rm -f conf.glibtest
     202+])
     203Index: m4/gtk.m4
     204===================================================================
     205--- /dev/null
     206+++ m4/gtk.m4
     207@@ -0,0 +1,194 @@
     208+# Configure paths for GTK+
     209+# Owen Taylor     97-11-3
     210+
     211+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
     212+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
     213+dnl
     214+AC_DEFUN([AM_PATH_GTK],
     215+[dnl
     216+dnl Get the cflags and libraries from the gtk-config script
     217+dnl
     218+AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
     219+            gtk_config_prefix="$withval", gtk_config_prefix="")
     220+AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
     221+            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
     222+AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
     223+                   , enable_gtktest=yes)
     224+
     225+  for module in . $4
     226+  do
     227+      case "$module" in
     228+         gthread)
     229+             gtk_config_args="$gtk_config_args gthread"
     230+         ;;
     231+      esac
     232+  done
     233+
     234+  if test x$gtk_config_exec_prefix != x ; then
     235+     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
     236+     if test x${GTK_CONFIG+set} != xset ; then
     237+        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
     238+     fi
     239+  fi
     240+  if test x$gtk_config_prefix != x ; then
     241+     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
     242+     if test x${GTK_CONFIG+set} != xset ; then
     243+        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
     244+     fi
     245+  fi
     246+
     247+  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
     248+  min_gtk_version=ifelse([$1], ,0.99.7,$1)
     249+  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
     250+  no_gtk=""
     251+  if test "$GTK_CONFIG" = "no" ; then
     252+    no_gtk=yes
     253+  else
     254+    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
     255+    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
     256+    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
     257+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     258+    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
     259+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     260+    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
     261+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     262+    if test "x$enable_gtktest" = "xyes" ; then
     263+      ac_save_CFLAGS="$CFLAGS"
     264+      ac_save_LIBS="$LIBS"
     265+      CFLAGS="$CFLAGS $GTK_CFLAGS"
     266+      LIBS="$GTK_LIBS $LIBS"
     267+dnl
     268+dnl Now check if the installed GTK is sufficiently new. (Also sanity
     269+dnl checks the results of gtk-config to some extent
     270+dnl
     271+      rm -f conf.gtktest
     272+      AC_TRY_RUN([
     273+#include <gtk/gtk.h>
     274+#include <stdio.h>
     275+#include <stdlib.h>
     276+
     277+int
     278+main ()
     279+{
     280+  int major, minor, micro;
     281+  char *tmp_version;
     282+
     283+  system ("touch conf.gtktest");
     284+
     285+  /* HP/UX 9 (%@#!) writes to sscanf strings */
     286+  tmp_version = g_strdup("$min_gtk_version");
     287+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
     288+     printf("%s, bad version string\n", "$min_gtk_version");
     289+     exit(1);
     290+   }
     291+
     292+  if ((gtk_major_version != $gtk_config_major_version) ||
     293+      (gtk_minor_version != $gtk_config_minor_version) ||
     294+      (gtk_micro_version != $gtk_config_micro_version))
     295+    {
     296+      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
     297+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
     298+             gtk_major_version, gtk_minor_version, gtk_micro_version);
     299+      printf ("*** was found! If gtk-config was correct, then it is best\n");
     300+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
     301+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
     302+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
     303+      printf("*** required on your system.\n");
     304+      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
     305+      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
     306+      printf("*** before re-running configure\n");
     307+    }
     308+#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
     309+  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
     310+          (gtk_minor_version != GTK_MINOR_VERSION) ||
     311+           (gtk_micro_version != GTK_MICRO_VERSION))
     312+    {
     313+      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
     314+            GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
     315+      printf("*** library (version %d.%d.%d)\n",
     316+            gtk_major_version, gtk_minor_version, gtk_micro_version);
     317+    }
     318+#endif /* defined (GTK_MAJOR_VERSION) ... */
     319+  else
     320+    {
     321+      if ((gtk_major_version > major) ||
     322+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
     323+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
     324+      {
     325+        return 0;
     326+       }
     327+     else
     328+      {
     329+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
     330+               gtk_major_version, gtk_minor_version, gtk_micro_version);
     331+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
     332+              major, minor, micro);
     333+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
     334+        printf("***\n");
     335+        printf("*** If you have already installed a sufficiently new version, this error\n");
     336+        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
     337+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
     338+        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
     339+        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
     340+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
     341+        printf("*** so that the correct libraries are found at run-time))\n");
     342+      }
     343+    }
     344+  return 1;
     345+}
     346+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
     347+       CFLAGS="$ac_save_CFLAGS"
     348+       LIBS="$ac_save_LIBS"
     349+     fi
     350+  fi
     351+  if test "x$no_gtk" = x ; then
     352+     AC_MSG_RESULT(yes)
     353+     ifelse([$2], , :, [$2])     
     354+  else
     355+     AC_MSG_RESULT(no)
     356+     if test "$GTK_CONFIG" = "no" ; then
     357+       echo "*** The gtk-config script installed by GTK could not be found"
     358+       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
     359+       echo "*** your path, or set the GTK_CONFIG environment variable to the"
     360+       echo "*** full path to gtk-config."
     361+     else
     362+       if test -f conf.gtktest ; then
     363+        :
     364+       else
     365+          echo "*** Could not run GTK test program, checking why..."
     366+          CFLAGS="$CFLAGS $GTK_CFLAGS"
     367+          LIBS="$LIBS $GTK_LIBS"
     368+          AC_TRY_LINK([
     369+#include <gtk/gtk.h>
     370+#include <stdio.h>
     371+],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
     372+        [ echo "*** The test program compiled, but did not run. This usually means"
     373+          echo "*** that the run-time linker is not finding GTK or finding the wrong"
     374+          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
     375+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
     376+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
     377+          echo "*** is required on your system"
     378+         echo "***"
     379+          echo "*** If you have an old version installed, it is best to remove it, although"
     380+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
     381+          echo "***"
     382+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
     383+          echo "*** came with the system with the command"
     384+          echo "***"
     385+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
     386+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
     387+          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
     388+          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
     389+          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
     390+          CFLAGS="$ac_save_CFLAGS"
     391+          LIBS="$ac_save_LIBS"
     392+       fi
     393+     fi
     394+     GTK_CFLAGS=""
     395+     GTK_LIBS=""
     396+     ifelse([$3], , :, [$3])
     397+  fi
     398+  AC_SUBST(GTK_CFLAGS)
     399+  AC_SUBST(GTK_LIBS)
     400+  rm -f conf.gtktest
     401+])
     402Index: m4/socklen.m4
     403===================================================================
     404--- /dev/null
     405+++ m4/socklen.m4
     406@@ -0,0 +1,23 @@
     407+###################################################################
     408+## To: autoconf@gnu.org
     409+## Subject: socklen_t
     410+## From: lars brinkhoff <lars@nocrew.org>
     411+## Date: 26 Mar 1999 11:38:09 +0100
     412+##
     413+## Here's an attempt at a check for socklen_t.  AC_CHECK_TYPE doesn't
     414+## work because it doesn't search <sys/socket.h>.  Maybe that macro
     415+## should be changed instead.
     416+##
     417+AC_DEFUN(AC_TYPE_SOCKLEN_T,
     418+[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
     419+[
     420+  AC_TRY_COMPILE(
     421+  [#include <sys/socket.h>],
     422+  [socklen_t len = 42; return len;],
     423+  ac_cv_type_socklen_t=yes,
     424+  ac_cv_type_socklen_t=no)
     425+])
     426+  if test $ac_cv_type_socklen_t != yes; then
     427+    AC_DEFINE(socklen_t, int)
     428+  fi
     429+])
  • files/patch-configure.diff

     
    1 --- configure   2001-04-24 21:25:46.000000000 +0200
    2 +++ configure   2008-08-22 15:12:57.000000000 +0200
    3 @@ -544,8 +544,8 @@
    4  ac_ext=c
    5  # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
    6  ac_cpp='$CPP $CPPFLAGS'
    7 -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
    8 -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
    9 +ac_compile='${CXX-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
    10 +ac_link='${CXX-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
    11  cross_compiling=$ac_cv_prog_cc_cross
    12  
    13  ac_exeext=
    14 @@ -932,8 +932,9 @@
    15  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    16    echo $ac_n "(cached) $ac_c" 1>&6
    17  else
    18 -  if test -n "$CC"; then
    19 -  ac_cv_prog_CC="$CC" # Let the user override the test.
    20 +# uses the C compiler for linking, so give it the C++ compiler right away...
    21 +  if test -n "$CXX"; then
    22 +  ac_cv_prog_CC="$CXX" # Let the user override the test.
    23  else
    24    IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
    25    ac_dummy="$PATH"
  • files/patch-Makefile.in.diff

     
    1 --- work/smpeg-0.4.4/Makefile.in        2001-06-18 22:59:14.000000000 +0200
    2 +++ Makefile.in 2005-09-30 08:56:31.000000000 +0200
    3 @@ -195,7 +195,7 @@
    4  SOURCES = $(libsmpeg_la_SOURCES) $(plaympeg_SOURCES) $(gtv_SOURCES) $(glmovie_SOURCES)
    5  OBJECTS = $(libsmpeg_la_OBJECTS) $(plaympeg_OBJECTS) $(gtv_OBJECTS) $(glmovie_OBJECTS)
    6  
    7 -all: all-redirect
    8 +all: all-redirect libsmpeg.$(VERSION).dylib
    9  .SUFFIXES:
    10  .SUFFIXES: .S .c .cpp .lo .o .s
    11  $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
    12 @@ -283,6 +283,9 @@
    13  libsmpeg.la: $(libsmpeg_la_OBJECTS) $(libsmpeg_la_DEPENDENCIES)
    14         $(CXXLINK) -rpath $(libdir) $(libsmpeg_la_LDFLAGS) $(libsmpeg_la_OBJECTS) $(libsmpeg_la_LIBADD) $(LIBS)
    15  
    16 +libsmpeg.$(VERSION).dylib:
    17 +       $(CXX) -dynamiclib MPEG*.o smpeg.o audio/*.o video/*.o -o $@ -current_version $(VERSION) -compatibility_version $(VERSION) -install_name $(libdir)/$@ $(LIBS)
    18 +
    19  mostlyclean-binPROGRAMS:
    20  
    21  clean-binPROGRAMS:
  • files/patch-libtool.diff

     
     1--- Makefile.in.orig    2010-09-25 00:07:42.000000000 +0200
     2+++ Makefile.in 2010-09-25 00:07:52.000000000 +0200
     3@@ -167,12 +167,12 @@
     4 
     5 CXXFLAGS = @CXXFLAGS@
     6 CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     7-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     8+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     9 CXXLD = $(CXX)
     10 CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
     11 CFLAGS = @CFLAGS@
     12 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     13-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     14+LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     15 CCLD = $(CC)
     16 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
     17 man1dir = $(mandir)/man1
     18--- audio/Makefile.in.orig      2010-09-25 00:07:42.000000000 +0200
     19+++ audio/Makefile.in   2010-09-25 00:07:59.000000000 +0200
     20@@ -116,7 +116,7 @@
     21 mpegtoraw.lo
     22 CXXFLAGS = @CXXFLAGS@
     23 CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     24-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     25+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     26 CXXLD = $(CXX)
     27 CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
     28 DIST_COMMON =  README AUTHORS COPYING.LIB Makefile.am Makefile.in
     29--- video/Makefile.in.orig      2010-09-25 00:07:42.000000000 +0200
     30+++ video/Makefile.in   2010-09-25 00:08:10.000000000 +0200
     31@@ -116,12 +116,12 @@
     32 vhar128.lo mmxflags_asm.lo mmxidct_asm.lo
     33 CXXFLAGS = @CXXFLAGS@
     34 CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     35-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     36+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     37 CXXLD = $(CXX)
     38 CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
     39 CFLAGS = @CFLAGS@
     40 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     41-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     42+LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     43 CCLD = $(CC)
     44 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
     45 DIST_COMMON =  README Makefile.am Makefile.in
  • files/patch-automake-as.diff

     
     1--- configure.in.orig
     2+++ configure.in
     3@@ -53,6 +53,8 @@ AC_LIBTOOL_WIN32_DLL
     4 AM_PROG_LIBTOOL
     5 AC_PROG_INSTALL
     6 
     7+AM_PROG_AS
     8+
     9 dnl Work around the lack of certain typedefs.
     10 AC_TYPE_SOCKLEN_T
     11 
  • files/patch-Makefile.am.diff

     
     1--- Makefile.am.orig    2010-09-25 01:27:11.000000000 +0200
     2+++ Makefile.am 2010-09-25 01:27:49.000000000 +0200
     3@@ -69,14 +69,17 @@
     4 man_MANS = plaympeg.1 gtv.1
     5 plaympeg_SOURCES = plaympeg.c
     6 plaympeg_LDADD = libsmpeg.la
     7+plaympeg_LINK = $(CXXLINK)
     8 
     9 # Sources for gtv
     10 gtv_SOURCES = gtv.c gtv.h
     11 gtv_LDADD = @GTK_LIBS@ libsmpeg.la
     12+gtv_LINK = $(CXXLINK)
     13 
     14 # Sources for glmovie
     15 glmovie_SOURCES = glmovie-tile.c glmovie.c glmovie.h
     16 glmovie_LDADD = @GL_LIBS@ libsmpeg.la
     17+glmovie_LINK = $(CXXLINK)
     18 
     19 # M4 macro file for inclusion with autoconf
     20 m4datadir = $(datadir)/aclocal
  • Portfile

     
    44
    55name            smpeg
    66version         0.4.4
    7 revision        8
     7revision        9
    88categories      multimedia
    99license         GPLv2
    1010maintainers     mww
     
    1515
    1616homepage        http://www.lokigames.com/development/smpeg.php3
    1717master_sites    ftp://ftp.lokigames.com/pub/open-source/smpeg/ \
    18                 macports macports:lt:lt freebsd
    19 distfiles-append        ltconfig13:lt ltmain13:lt
    20 extract.only    ${distname}${extract.suffix}
    21 
    22 checksums       ${distname}${extract.suffix} md5 59c76ac704088ef5539210190c4e1fe3 \
    23                 ltconfig13 md5 ea53f42a550c9f9e653758a8ed91574e \
    24                 ltmain13 md5 e094ae92724c4015dbab97de151c2525
     18                macports freebsd
    2519
    26 depends_build   port:libtool
     20checksums       md5 59c76ac704088ef5539210190c4e1fe3
    2721
    2822depends_lib     path:lib/pkgconfig/sdl.pc:libsdl
    2923
    3024patchfiles      patch-smpeg.h.diff patch-glmovie-tile.c.diff \
    31                 patch-glmovie.c.diff patch-Makefile.in.diff patch-configure.diff \
     25                patch-glmovie.c.diff \
    3226                patch-smpeg.m4.diff patch-MPEGaudio.h.diff patch-video.h.diff \
    33                 patch-MPEG.cpp.diff
     27                patch-MPEG.cpp.diff patch-smpeg-gtkm4.diff patch-automake-as.diff \
     28                patch-configure-flags.diff patch-Makefile.am.diff
     29
    3430post-patch {
    35         file copy -force ${distpath}/ltconfig13 ${worksrcpath}/ltconfig
    36         file copy -force ${distpath}/ltmain13 ${worksrcpath}/ltmain.sh
     31        file delete ${worksrcpath}/acinclude.m4
     32        touch ${worksrcpath}/NEWS
     33        touch ${worksrcpath}/AUTHORS
     34        touch ${worksrcpath}/ChangeLog
    3735}
    3836
     37use_autoreconf  yes
     38autoreconf.args --include=${worksrcpath}/m4
     39
    3940configure.args  --without-x \
    4041                --disable-gtktest \
    4142                --disable-gtk-player \
    42                 --disable-static \
     43                --enable-static \
     44                --enable-shared \
    4345                --disable-sdltest \
    4446                --mandir=${prefix}/share/man \
    45                 --enable-shared=no
    4647
    47 configure.ccache no
    4848configure.ldflags-append -framework OpenGL
    4949
    5050use_parallel_build      no
    51 
    52 post-configure {
    53         # It's too much of a PITA to autoreconf
    54         delete ${worksrcpath}/libtool
    55         file copy -force ${prefix}/bin/glibtool ${worksrcpath}/libtool
    56 }