$NetBSD: patch-aa,v 1.5 2009/02/17 19:49:57 joerg Exp $ --- Makefile.in.orig 2007-03-11 00:11:11.000000000 +0100 +++ Makefile.in @@ -5,6 +5,7 @@ # CC= @CC@ +CPPFLAGS= @CPPFLAGS@ CFLAGS= @CFLAGS@ RANLIB= @RANLIB@ INSTALL= @INSTALL@ @@ -28,7 +29,7 @@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ INST_OTCLSH= @prefix@/bin INST_OWISH= @prefix@/bin INST_OLIB= @prefix@/lib -INST_OLIBSH= @INST_OLIBSH@ +INST_OLIBSH= @prefix@/lib INST_OINC= @prefix@/include @@ -40,7 +41,6 @@ INCLUDES = \ -I. \ @V_INCLUDES@ \ @V_INCLUDE_X11@ \ - -I@includedir@ \ @V_INCLUDE@ DEFINES = \ @@ -58,9 +58,9 @@ MV= mv -f CFILES = otcl.c otclAppInit.c otkAppInit.c .c.o: - $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< + ${LIBTOOL} --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES) $< -all: libotcl.a libotcl$(SHLIB_SUFFIX) otclsh owish +all: libotcl.a otclsh owish # # compile an appinit with tcl and otcl and link against @@ -69,8 +69,8 @@ all: libotcl.a libotcl$(SHLIB_SUFFIX) ot otclsh: otclAppInit.c libotcl.a rm -f libotcl$(SHLIB_SUFFIX) - $(CC) -o otclsh $(SHLD_FLAGS) $(CFLAGS) $(INCLUDES) otclAppInit.c \ - $(OTCLLIB) $(LIB) + ${LIBTOOL} --mode=link $(CC) -o otclsh $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(LDFLAGS) otclAppInit.c \ + ./libotcl.la $(LIB) # # compile an appinit with tcl/tk and otcl and link against @@ -79,8 +79,8 @@ otclsh: otclAppInit.c libotcl.a owish: otkAppInit.c libotcl.a rm -f libotcl$(SHLIB_SUFFIX) - $(CC) -o owish $(SHLD_FLAGS) $(CFLAGS) $(INCLUDES) otkAppInit.c \ - $(OTCLLIB) $(LIB) + ${LIBTOOL} --mode=link $(CC) -o owish $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(LDFLAGS) otkAppInit.c \ + ./libotcl.la $(LIB) # # compile otcl.c and link it into a library archive @@ -89,19 +89,8 @@ owish: otkAppInit.c libotcl.a libotcl.a: otcl.c rm -f libotcl.a otcl.o - $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) otcl.c - ar cq libotcl.a otcl.o - $(RANLIB) libotcl.a - -# -# compile otcl.c and link it into a shared object -# INCLUDES give a path to tclInt.h (plus tk and X11) -# - -libotcl$(SHLIB_SUFFIX): otcl.c - rm -f libotcl$(SHLIB_SUFFIX) otcl.o so_locations - $(CC) -c $(CFLAGS) $(DEFINES) $(SHLIB_CFLAGS) $(INCLUDES) otcl.c - $(SHLIB_LD) -o libotcl$(SHLIB_SUFFIX) otcl.o + ${LIBTOOL} --mode=compile $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) otcl.c + ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} otcl.lo -rpath ${PREFIX}/lib -version-info 0:0 test: otclsh owish ./otclsh lib/test.tcl @@ -114,13 +103,11 @@ dirs: fi;\ done -install: owish otclsh libotcl.a libotcl$(SHLIB_SUFFIX) otcl.h dirs - $(INSTALL) owish $(INST_OWISH) - $(INSTALL) otclsh $(INST_OTCLSH) - $(INSTALL) libotcl.a $(INST_OLIB) - $(RANLIB) $(INST_OLIB)/libotcl.a - $(INSTALL) libotcl$(SHLIB_SUFFIX) $(INST_OLIBSH) - $(INSTALL) -m 644 otcl.h $(INST_OINC) +install: owish otclsh libotcl.a otcl.h dirs + ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} libotcl.la ${DESTDIR}${PREFIX}/lib + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} owish ${DESTDIR}$(INST_OWISH) + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} otclsh ${DESTDIR}$(INST_OTCLSH) + $(INSTALL) -m 644 otcl.h ${DESTDIR}$(INST_OINC) clean: rm -f owish otclsh libotcl.a libotcl$(SHLIB_SUFFIX) \ @@ -154,7 +141,7 @@ srctar: depend: $(CFILES) @echo Making dependencies for $(srcdir){$(CFILES)} - @$(CC) -MM $(CFLAGS) $(INCLUDES) $(DEFINES) $(CFILES) > makedep + @$(CC) -MM $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(DEFINES) $(CFILES) > makedep @echo '/^# DO NOT DELETE THIS LINE/+1,$$d' > eddep @echo '$$r makedep' >> eddep @echo 'w' >>eddep