[ptx] Building [PanoTools] on mac OS X

Bruno Postle bruno at postle.net
Thu Feb 26 12:50:26 GMT 2004


[I'm resending this message to the ptx list so I can find it in a
web archive - I originally sent it to panotools-devel, but the
sourceforge archives are useless - Bruno]

I've had some success building pano12 on osX.

The old mac-classic makefile was no use, so I decided to build a
non-gui library based on the linux Makefile.  I've attached the
modified 'makefile.osx'.

The other attachment is a patch to fix a macro in panorama.h to
force an ansi rather than a mac library.

The makefile builds a "libpano12.a" archive.

Notice that I haven't yet figured-out how to build a linkable
library - Suggestions welcome (obviously I don't really know what
I'm doing with this stuff).

I know I've got something right because I can compile a fully
working PTOptimizer like so:

   cd tools
   gcc -o PTOptimizer -I.. -L/sw/lib -ljpeg -ltiff PTOptimizer.c ../libpano12.a

-- 
Bruno
-------------- next part --------------
# Makefile for libpano12.a

sources = panorama.h filter.h fftn.h f2c.h pteditor.h  \
          ptutils.h version.h \
          filter.c parser.c correct.c perspect.c \
          adjust.c  remap.c lmdif.c  file.c \
	  math.c pan.c PTDialogs.c fftn.c fourier.c resample.c \
          optimize.c morpher.c Triangulate.c \
	  seamer.c ptpicker.c pteditor.c seamer_.c \
          tiff.c bmp.c jpeg.c png.c  multilayer.c \
          Makefile pano12.rc pano12.def sys_ansi.c ppm.c

objects = filter.o parser.o  correct.o perspect.o \
          adjust.o  remap.o lmdif.o  file.o math.o pan.o \
          PTDialogs.o fftn.o fourier.o resample.o optimize.o \
          morpher.o Triangulate.o seamer.o ptpicker.o pteditor.o \
          tiff.o jpeg.o png.o multilayer.o 

ansobj =  sys_ansi.o ppm.o

CC = gcc
#CC = gcc3

CFLAGS = -O \
	-I/usr/include/gcc/darwin/default \
	-I/sw/include \
	-I/usr/include \
	-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers   \
	-D__Ansi__=1

libpano12.a	: $(objects) $(ansobj)
	$(CC) \
	-o libpano12.dylib \
	-L/usr/lib/gcc/darwin/default \
	-L/sw/lib \
	-L/usr/lib \
	-ljpeg \
	-lm \
	-ltiff \
	-lpng \
	-flat_namespace \
	-undefined suppress \
	$(objects) $(ansobj)	
	rm libpano12.dylib
	ar rc libpano12.a *.o
	ranlib libpano12.a

install : libpano12.a
	mv libpano12.a /usr/local/lib/

-------------- next part --------------
Index: panorama.h
===================================================================
RCS file: /cvsroot/panotools/libpano/panorama.h,v
retrieving revision 1.3
diff -r1.3 panorama.h
47c47
< 	#if (defined(macintosh) || defined(__MC68K__) || defined(__POWERPC__) || defined(__powerc))
---
> 	#if (defined(macintosh) || defined(__MC68K__) || defined(__powerc))


More information about the ptX mailing list