]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
build: add -without-python
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 20 Jan 2011 16:14:51 +0000 (14:14 -0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Jan 2011 17:17:54 +0000 (18:17 +0100)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Makefile.in
configure.ac

index e764e61c65c5ed50e4702a5c13a72261210f3f67..74e90971d9390f4a6b103aba1ff1a723f1fa5da7 100644 (file)
@@ -77,7 +77,7 @@ showkey:      showkey.o $(LIBNEWT)
        $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
 
 _snackmodule.so:   snackmodule.c $(LIBNEWTSH)
-       for ver in $(PYTHONVERS) ; do \
+       [ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
                mkdir -p $$ver ;\
                        PCFLAGS=`$$ver-config --cflags`; \
                        PIFLAGS=`$$ver-config --includes`; \
@@ -85,7 +85,7 @@ _snackmodule.so:   snackmodule.c $(LIBNEWTSH)
                        PLFLAGS=`$$ver-config --libs`; \
                $(CC) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c ;\
                $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L.  -lnewt $(LIBS);\
-       done
+       done || :
        touch $@
 
 whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
@@ -141,11 +141,11 @@ install-sh: sharedlib $(WHIPTCLSO) _snackmodule.so
        ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.so
        ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME)
        [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.so $(instroot)/$(libdir) || :
-       for ver in $(PYTHONVERS) ; do \
+       [ -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 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
-       done
+       done || :
 
 Makefile: newt.spec
        echo "You need to rerun ./configure before continuing"
index 7bc381a950472d6460ad2f79db67273fb8a7563d..dc0435239c6afb798982caa969564d0312c6c9db 100644 (file)
@@ -54,8 +54,14 @@ fi
 AC_CHECK_HEADERS([popt.h libintl.h])
 
 AC_MSG_CHECKING([for python versions])
-PYTHONVERS=$(echo /usr/include/python*/Python.h | sed "s|/usr/include/||g"| sed "s|/Python.h||g" 2> /dev/null)
-AC_MSG_RESULT([$PYTHONVERS])
+AC_ARG_WITH([python], [  --without-python        do not compile python support])
+if test "x$with_python" = "xno"; then
+  AC_MSG_RESULT([skipped])
+  PYTHONVERS=
+else
+  PYTHONVERS=$(ls /usr/include/python*/Python.h 2> /dev/null | sed "s|/usr/include/||g"| sed "s|/Python.h||g" 2> /dev/null)
+  AC_MSG_RESULT([$PYTHONVERS])
+fi
 AC_SUBST([PYTHONVERS])
 
 AC_ARG_WITH([tcl], [  --without-tcl           do not compile whiptcl.so])