From: Miroslav Lichvar Date: Wed, 31 Jul 2013 11:44:59 +0000 (+0200) Subject: modify Makefile to use SOEXT (#971168) X-Git-Tag: r0-52-16~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=673e30095776571c4e59ad44d93ed040828ea43f;p=thirdparty%2Fnewt.git modify Makefile to use SOEXT (#971168) --- diff --git a/Makefile.in b/Makefile.in index aff74d7..7e38052 100644 --- a/Makefile.in +++ b/Makefile.in @@ -11,17 +11,23 @@ GNU_LD = @GNU_LD@ VERSION = @VERSION@ TAG = r$(subst .,-,$(VERSION)) SONAME = @SONAME@ +SOEXT = so PYTHONVERS = @PYTHONVERS@ -WHIPTCLSO = @WHIPTCLSO@ +WHIPTCLLIB = @WHIPTCLLIB@ +ifneq ($(WHIPTCLLIB),) +WHIPTCLSO = $(WHIPTCLLIB).$(SOEXT) +else +WHIPTCLSO = +endif PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey TESTOBJS = test.o testgrid.o testtree.o showchars.o showkey.o NDIALOGOBJS = whiptail.o dialogboxes.o WHIPTCLOBJS = shared/whiptcl.o shared/dialogboxes.o LIBNEWT = libnewt.a -LIBNEWTSH = libnewt.so.$(VERSION) -LIBNEWTSONAME = libnewt.so.$(SONAME) +LIBNEWTSH = libnewt.$(SOEXT).$(VERSION) +LIBNEWTSONAME = libnewt.$(SOEXT).$(SONAME) LIBOBJS = newt.o button.o form.o checkbox.o entry.o label.o listbox.o \ scrollbar.o textbox.o scale.o grid.o windows.o buttonbar.o \ checkboxtree.o @@ -59,7 +65,7 @@ else TARGET=depend $(PROGS) endif -all: $(TARGET) _snackmodule.so +all: $(TARGET) _snackmodule.$(SOEXT) test: test.o $(LIBNEWT) $(CC) -g -o test test.o $(LIBNEWT) $(LDFLAGS) $(LIBS) @@ -76,7 +82,7 @@ showchars: showchars.o $(LIBNEWT) showkey: showkey.o $(LIBNEWT) $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS) -_snackmodule.so: snackmodule.c $(LIBNEWTSH) +_snackmodule.$(SOEXT): snackmodule.c $(LIBNEWTSH) @[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS); do \ pyconfig=$$ver-config; \ if ! $$pyconfig --cflags > /dev/null 2>&1 && \ @@ -91,16 +97,16 @@ _snackmodule.so: snackmodule.c $(LIBNEWTSH) PLFLAGS=`$$pyconfig --libs`; \ echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ - echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ - $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.$(SOEXT) $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.$(SOEXT) $$ver/snackmodule.o -L. -lnewt $(LIBS); \ done || : touch $@ whiptail: $(NDIALOGOBJS) $(LIBNEWTSH) $(CC) -g -o whiptail $(NDIALOGOBJS) -L. $(LDFLAGS) -lnewt $(LIBS) -lpopt -whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH) - $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS) +whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNEWTSH) + $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS) $(LIBNEWT): $(LIBOBJS) ar rv $@ $^ @@ -112,7 +118,7 @@ veryclean: clean clean: rm -f $(PROGS) *.o $(LIBNEWT) core $(LIBNEWTSH) \ - $(SHAREDDIR)/*.o *.so* + $(SHAREDDIR)/*.o *.$(SOEXT)* depend: $(CPP) $(CFLAGS) $(CPPFLAGS) -M $(SOURCES) > .depend @@ -124,7 +130,7 @@ sharedlib: $(LIBNEWTSH) $(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS) $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS) - ln -fs $(LIBNEWTSONAME) libnewt.so + ln -fs $(LIBNEWTSONAME) libnewt.$(SOEXT) ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME) $(SHAREDDIR)/%.o : %.c @@ -143,15 +149,15 @@ install: $(LIBNEWT) install-sh whiptail make -C po datadir=$(instroot)/$(datadir) install install -m 644 libnewt.pc $(instroot)/$(pkgconfigdir) -install-sh: sharedlib $(WHIPTCLSO) _snackmodule.so +install-sh: sharedlib $(WHIPTCLSO) _snackmodule.$(SOEXT) [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir) install -m 755 $(LIBNEWTSH) $(instroot)/$(libdir) - ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.so + ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.$(SOEXT) ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME) - [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.so $(instroot)/$(libdir) || : + [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.$(SOEXT) $(instroot)/$(libdir) || : [ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \ [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\ - install -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\ + install -m 755 $$ver/_snackmodule.$(SOEXT) $(instroot)/$(libdir)/$$ver/site-packages ;\ install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\ done || : diff --git a/configure.ac b/configure.ac index 467fc1a..02f9d6d 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,7 @@ AC_SUBST([PYTHONVERS]) AC_ARG_WITH([tcl], [ --without-tcl do not compile whiptcl.so]) if test "x$with_tcl" = "xno"; then - WHIPTCLSO= + WHIPTCLLIB= else AC_MSG_CHECKING([for tcl configuration]) @@ -96,14 +96,14 @@ else AC_MSG_RESULT([found]) . ${ac_cv_c_tclconfig}/tclConfig.sh AC_SUBST([TCL_LIB_FLAG]) - WHIPTCLSO=whiptcl.so + WHIPTCLLIB=whiptcl # needed with tcl8.6 CPPFLAGS="$CPPFLAGS -DUSE_INTERP_RESULT" else AC_MSG_RESULT([NOT found]) fi fi -AC_SUBST([WHIPTCLSO]) +AC_SUBST([WHIPTCLLIB]) AC_ARG_WITH([gpm-support], [ --with-gpm-support compile with GPM support])