[GEM-dev] Re: [GEM-cvs] Gem/src/Gnu configure.in

=?X-UNKNOWN?Q?g=FCnter_geiger?= geiger at xdv.org
Tue May 24 09:30:07 CEST 2005



FYI, I have rewritten the Gem build system for my debian packaging,
a patch against 0.90 is attached. I haven't checked if it works with
the CVS version, but  in general it should be a lot cleaner than the
current build system. It might need some adaptions for a non-linux
target, but at least its a clean start.

Guenter


On Tue, 24 May 2005, IOhannes m zmoelnig wrote:

> james tittle wrote:
> > On May 23, 2005, at 11:21 AM, IOhannes m zmoelnig wrote:
> >
> > ...but now I've run into another problem:  pre-10.4, math.h didn't
> > define sinf() & friends...so we made "macosx_math.h" in GemLibs/
> > darwinStuff...now that it's defined on 10.4, I'm trying to
> > conditionally find out if sinf is in math.h...I've done this by using  a
> > macro I found at the link you referred to above:
> >
> > http://autoconf-archive.cryp.to/ac_check_func_in.html
> >
> > ...and tried:
> >
> > dnl on osx, sinf() wasn't defined pre-10.4
> > if test `uname -s` == Darwin;
> >   then
> > AC_CHECK_FUNC_IN(math.h, sinf, CXXFLAGS="$CXXFLAGS -DHAS_SINF",
> >                     INCLUDES = "$INCLUDES ../../../GemLibs/ darwinStuff")
> > fi
> >
> > ...but I haven't figured out where to put the "M4 source code"?  I
> > first tried to copy/paste from the webpage into acinclude.m4, but  when
> > I run "autoconf" again, it gives this:
> >
> > tiggity:~/puredataDev/Gem/src/gnu tigital$ autoconf
> > configure.in:611: error: possibly undefined macro: AC_CHECK_FUNC_IN
> >       If this token and others are legitimate, please use
> > m4_pattern_allow.
> >       See the Autoconf documentation.
>
>
> i guess it is like:
> paste the code into acinclude.m4
> run "aclocal"
> run "autoconf"
> run "./configure"
>
>
> mfg.a.dr.
> IOhannes
>
> >
> > any ideas?
> > jamie
>
>
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev
>
-------------- next part --------------
diff -ruN gem-0.90.0-old/src/Gnu/aclocal.m4 gem-0.90.0/src/Gnu/aclocal.m4
--- gem-0.90.0-old/src/Gnu/aclocal.m4	1970-01-01 01:00:00.000000000 +0100
+++ gem-0.90.0/src/Gnu/aclocal.m4	2004-12-07 10:46:58.000000000 +0100
@@ -0,0 +1,70 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+  succeeded=no
+
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  if test "$PKG_CONFIG" = "no" ; then
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        AC_MSG_CHECKING(for $2)
+
+        if $PKG_CONFIG --exists "$2" ; then
+            AC_MSG_RESULT(yes)
+            succeeded=yes
+
+            AC_MSG_CHECKING($1_CFLAGS)
+            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+            AC_MSG_RESULT($$1_CFLAGS)
+
+            AC_MSG_CHECKING($1_LIBS)
+            $1_LIBS=`$PKG_CONFIG --libs "$2"`
+            AC_MSG_RESULT($$1_LIBS)
+        else
+            $1_CFLAGS=""
+            $1_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but 
+            ## do set a variable so people can do so.
+            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+            ifelse([$4], ,echo $$1_PKG_ERRORS,)
+        fi
+
+        AC_SUBST($1_CFLAGS)
+        AC_SUBST($1_LIBS)
+     else
+        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+        echo "*** See http://www.freedesktop.org/software/pkgconfig"
+     fi
+  fi
+
+  if test $succeeded = yes; then
+     ifelse([$3], , :, [$3])
+  else
+     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+  fi
+])
+
+
+
diff -ruN gem-0.90.0-old/src/Gnu/configure.ac gem-0.90.0/src/Gnu/configure.ac
--- gem-0.90.0-old/src/Gnu/configure.ac	1970-01-01 01:00:00.000000000 +0100
+++ gem-0.90.0/src/Gnu/configure.ac	2004-12-07 10:43:11.000000000 +0100
@@ -0,0 +1,119 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.57)
+AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
+AC_CONFIG_HEADER([../Base/configLinux.h])
+AC_CONFIG_SRCDIR([../Base/GemBase.h])
+
+AC_SUBST(INCLUDES)
+AC_SUBST(LIBS)
+AC_SUBST(X_LIBS)
+AC_SUBST(X_CFLAGS)
+AC_SUBST(CXXFLAGS)
+AC_SUBST(DEFINES)
+AC_SUBST(PKG_CFLAGS)
+AC_SUBST(PKG_LIBS)
+AC_SUBST(prefix)
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for libraries.
+
+AC_PATH_XTRA
+LIBS="$LIBS $X_LIBS"
+
+
+AC_CHECK_LIB(m,sin)
+AC_CHECK_LIB(z,main)
+AC_CHECK_LIB(dl,dlopen)
+
+AC_CHECK_LIB(X11,main)
+AC_CHECK_LIB(Xext,main)
+AC_CHECK_LIB(Xxf86vm,XF86VidModeGetAllModeLines)
+
+AC_CHECK_LIB(Xext,main)
+
+AC_CHECK_LIB(GL,glInitNames)
+AC_CHECK_LIB(GLU,gluLookAt)
+
+AC_CHECK_LIB(tiff, TIFFOpen)
+AC_CHECK_LIB(jpeg, jpeg_read_header)
+AC_CHECK_LIB(png, png_set_compression_level)
+
+AC_CHECK_LIB(aviplay,main)
+AC_CHECK_LIB(quicktime, quicktime_init)
+AC_CHECK_LIB(mpeg3,main)
+# AC_CHECK_LIB(dv,main) 
+AC_CHECK_LIB(ftgl,main,
+  AC_DEFINE(HAVE_LIBFTGL)
+  INCLUDES="$INCLUDES -I/usr/include/FTGL" && LIBS="-lftgl $LIBS")
+
+# pkg-config checks
+
+PKG_CHECK_MODULES(PKG,freetype2)
+
+########################################################################################
+# strange hacks
+
+AC_CHECK_LIB(gltt, GLTTFont,
+  AC_DEFINE(HAVE_LIBGLTT)
+  INCLUDES="$INCLUDES -I/usr/include/gltt" && LIBS="-lgltt $LIBS")
+
+AC_CHECK_LIB(aviplay,main,
+  AC_DEFINE(HAVE_LIBAVIPLAY)
+  INCLUDES="$INCLUDES -I/usr/include/avifile-0.7" && LIBS="-laviplay $LIBS")
+
+
+# locally build FFMPEG
+
+if test -f ../../ffmpeg/libavformat/libavformat.a -a -f ../../ffmpeg/libavcodec/libavcodec.a
+then
+   LIBS="$LIBS ../../ffmpeg/libavformat/libavformat.a ../../ffmpeg/libavcodec/libavcodec.a"
+   AC_DEFINE(HAVE_LIBAVFORMAT,[],["FFMPEG libraries compiled"])
+   AC_DEFINE(HAVE_LIBAVCODEC,[],["FFMPEG libraries compiled"])
+fi
+
+# end of strange hacks
+#########################################################################################
+
+
+# Checks for header files.
+AC_PATH_X
+AC_HEADER_STDC
+AC_CHECK_HEADERS([fcntl.h float.h memory.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/time.h termios.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MALLOC
+AC_FUNC_MMAP
+AC_CHECK_FUNCS([bzero floor gettimeofday memset munmap pow sqrt strchr strdup strrchr strstr])
+
+AC_CONFIG_FILES([Make.config])
+AC_OUTPUT
+
+echo GEM compilation options:
+echo =======================================
+echo
+echo FTGL support:         $ac_cv_lib_ftgl_main
+echo GLTT support:         $ac_cv_lib_gltt_GLTTFont
+echo libmpeg3 support:     $ac_cv_lib_mpeg3_main
+echo libquicktime support: $ac_cv_lib_quicktime_quicktime_init
+echo aviplay support:      $ac_cv_lib_aviplay_main
+echo libdv support:        $ac_cv_lib_dv_main
+echo
+echo ========================================
+
+
diff -ruN gem-0.90.0-old/src/Gnu/Make.config.in gem-0.90.0/src/Gnu/Make.config.in
--- gem-0.90.0-old/src/Gnu/Make.config.in	1970-01-01 01:00:00.000000000 +0100
+++ gem-0.90.0/src/Gnu/Make.config.in	2004-12-07 10:43:11.000000000 +0100
@@ -0,0 +1,12 @@
+
+
+CXXLINK = $(CXX) -o $@
+
+CXXFLAGS= -fPIC @CXXFLAGS@ @X_CFLAGS@ @PKG_CFLAGS@ -I.. @INCLUDES@ @DEFINES@
+LDFLAGS = @LDFLAGS@ @X_LIBS@
+LIBS = @LIBS@ @PKG_LIBS@
+SHARED = -shared
+STRIP = strip --strip-unneeded -R .note -R .comment
+
+PDLIBDIR = @prefix@/lib/pd
+
diff -ruN gem-0.90.0-old/src/Gnu/Makefile gem-0.90.0/src/Gnu/Makefile
--- gem-0.90.0-old/src/Gnu/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ gem-0.90.0/src/Gnu/Makefile	2004-12-07 10:43:11.000000000 +0100
@@ -0,0 +1,73 @@
+include Make.config
+
+TARG_DIR = ../Manips ../Particles ../Base ../MarkEx ../Pixes ../Controls ../Nongeos ../Geos ../openGL
+BUILDDIR = ../Gnu
+
+
+OBJECTS = ../Manips/*.o \
+         ../Particles/*.o \
+         ../Base/*.o \
+         ../MarkEx/*.o \
+         ../Pixes/*.o \
+         ../Controls/*.o \
+         ../Nongeos/*.o \
+         ../Geos/*.o \
+	 ../openGL/*.o \
+
+all: subdirs Gem.pd_linux
+
+Gem.static:
+#	-ld  $(OBJECTS) $(LIBS) $(X_LIBS) /usr/bin/pd
+
+Gem.pd_linux: Gem.static $(Gem_pd_DEPENDENCIES)
+	$(CXXLINK) $(SHARED) $(OBJECTS) $(LIBS) $(X_LIBS)
+	$(STRIP) Gem.pd_linux
+
+subdirs:
+	for d in ${TARG_DIR}; do \
+	    echo ""\
+	    echo "----------$$d----------"; \
+	    ${MAKE} -C $$d -f $(BUILDDIR)/Makefile.subdir -j4|| exit -1; \
+	done
+
+
+depend:
+	@for d in ${TARG_DIR}; do \
+	    echo "\n----------$$d----------"; \
+	    ${MAKE} -f $(BUILDDIR)/Makefile.subdir -C $$d depend; \
+	done
+
+
+clean:
+	@for d in ${TARG_DIR}; do \
+	    echo "\n----------$$d----------"; \
+	    ${MAKE} -f $(BUILDDIR)/Makefile.subdir -C $$d clean; \
+	done
+	-rm Gem.pd_linux *~ Gem.static
+
+
+install: installdocs
+	install -m644 -D Gem.pd_linux $(DESTDIR)/$(PDLIBDIR)/extra/Gem.pd_linux
+
+
+installdocs:
+	install -d $(DESTDIR)/$(PDLIBDIR)/doc/gem
+	cp -r ../../examples $(DESTDIR)/$(PDLIBDIR)/doc/gem
+       
+	install -d $(DESTDIR)/$(PDLIBDIR)/doc/5.reference/Gem
+	install -m644 ../../help/*.* $(DESTDIR)/$(PDLIBDIR)/doc/5.reference/Gem
+	ln -s Gem $(DESTDIR)/$(PDLIBDIR)/doc/5.reference/help-Gem
+
+distclean: clean
+	@for d in ${TARG_DIR}; do \
+	    echo "\n----------$$d----------"; \
+	    cd $$d ; ${MAKE} -f $(BUILDDIR)/Makefile.subdir distclean; \
+	done
+	-rm config.cache config.log config.status Make.config
+
+Make.config: Make.config.in configure
+	./configure
+
+configure: configure.ac
+	#autoheader && aclocal && autoconf
+
diff -ruN gem-0.90.0-old/src/Gnu/Makefile.subdir gem-0.90.0/src/Gnu/Makefile.subdir
--- gem-0.90.0-old/src/Gnu/Makefile.subdir	2003-04-28 19:22:30.000000000 +0200
+++ gem-0.90.0/src/Gnu/Makefile.subdir	2004-12-07 10:43:11.000000000 +0100
@@ -1,39 +1,20 @@
+include ../Gnu/Make.config
 
-
-include Make.source
-
+SOURCES = $(shell ls *.cpp)
 OBJECTS = $(SOURCES:.cpp=.o)
 
-CXX = @CXX@
-CC = @CC@
-
-ARCH = $(shell uname --machine)
-
-ifeq (${ARCH},alpha)
-AFLAGS = -mieee  -mcpu=ev56
-endif
-
-
-cxxflags = -g @CXXFLAGS@ $(AFLAGS) -I../ @INCLUDES@
-#cxxflags += -Wall -pedantic -ansi -Dunix -D__linux__
-cxxflags += -fno-builtin -O3 -funroll-loops -ffast-math
-cxxflags += $(CXXFLAGS)
-
-
 all: $(OBJECTS)
 
-
 depend:
-	$(CXX) -M $(cxxflags) $(SOURCES) > Make.depend
-
+	$(CXX) -M $(CXXFLAGS) $(SOURCES) > Make.depend
 
 clean:
 	-rm $(OBJECTS) *~
 
 distclean:
-	-rm Makefile.in Makefile Make.source Make.depend Make.depend.bak
+	-rm Makefile Make.depend 
 	touch Make.depend
 	if which dos2unix; then dos2unix *.cpp *.h; fi
 
 %.o: %.cpp
-	$(CXX) -c $(cxxflags) $*.cpp -o $*.o
+	$(CXX) -c $(CXXFLAGS) $*.cpp -o $*.o


More information about the GEM-dev mailing list