devashishbcsingh / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Build failure on OS X #245

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Try to build mod_wsgi-3.3 on Mac OS X 10.7.1 (using www/ap2-wsgi in pkgsrc). 
HTTP server is Apache 2.2.19, Python version is 2.6.6. 

What is the expected output? What do you see instead?

It fails due to several "unknown options" that are passed to apxs. 
Specifically, it does not seem to like the "-isystem" option.

===> Building for ap22-py26-wsgi-3.3
/usr/pkg/sbin/apxs -c -no-cpp-precomp -isystem /usr/include
-I/usr/include -I/usr/pkg/include -I/usr/pkg/include/apr-1
-I/usr/pkg/include/python2.6 -DHAVE_DB_185_H -DNDEBUG -DHAVE_DB_185_H
-Wc,-pipe -Wc,-O2 -Wc,-I/usr/include -Wc,-I/usr/pkg/include
-Wc,-I/usr/pkg/include/apr-1  -Wc,'-arch i386' mod_wsgi.c -L/usr/lib
-L/usr/pkg/lib -L/usr/pkg/lib -L/usr/pkg/lib/python2.6/config  -arch
i386 -lpython2.6 -ldl  -framework CoreFoundation
apxs:Error: Unknown option: s.
apxs:Error: Unknown option: y.
apxs:Error: Unknown option: s.
apxs:Error: Unknown option: t.
apxs:Error: Unknown option: m.
Usage: apxs -g [-S <var>=<val>] -n <modname>
      apxs -q [-S <var>=<val>] <query> ...
      apxs -c [-S <var>=<val>] [-o <dsofile>] [-D <name>[=<value>]]
              [-I <incdir>] [-L <libdir>] [-l <libname>] [-Wc,<flags>]
              [-Wl,<flags>] [-p] <files> ...
      apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...
      apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...
*** Error code 1

Please use labels and text to provide additional information.

This is the Makefile generated by bmake configure:

pkgsrc>$ cat www/ap2-wsgi/work/mod_wsgi-3.3/Makefile

#  Copyright 2007 GRAHAM DUMPLETON
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

APXS = /usr/pkg/sbin/apxs
PYTHON = /usr/pkg/bin/python2.6

DESTDIR =
LIBEXECDIR = /usr/pkg/lib/httpd

CPPFLAGS = -no-cpp-precomp -isystem /usr/include -I/usr/include
-I/usr/pkg/include -I/usr/pkg/include/apr-1
-I/usr/pkg/include/python2.6 -DHAVE_DB_185_H -DNDEBUG -DHAVE_DB_185_H
CFLAGS =  -Wc,-pipe -Wc,-O2 -Wc,-I/usr/include -Wc,-I/usr/pkg/include
-Wc,-I/usr/pkg/include/apr-1  -Wc,'-arch i386'
LDFLAGS = -L/usr/lib -L/usr/pkg/lib -L/usr/pkg/lib
-L/usr/pkg/lib/python2.6/config  -arch i386
LDLIBS =  -lpython2.6 -ldl  -framework CoreFoundation

all : mod_wsgi.la

mod_wsgi.la : mod_wsgi.c
       $(APXS) -c $(CPPFLAGS) $(CFLAGS) mod_wsgi.c $(LDFLAGS) $(LDLIBS)

$(DESTDIR)$(LIBEXECDIR) :
       mkdir -p $@

install : all $(DESTDIR)$(LIBEXECDIR)
       $(APXS) -i -S LIBEXECDIR=$(DESTDIR)$(LIBEXECDIR) -n 'mod_wsgi' mod_wsgi.la

clean :
       -rm -rf .libs
       -rm -f mod_wsgi.o mod_wsgi.la mod_wsgi.lo mod_wsgi.slo mod_wsgi.loT
       -rm -f config.log config.status
       -rm -rf autom4te.cache

distclean : clean
       -rm -f Makefile Makefile.in

realclean : distclean
       -rm -f configure

[end file]

mod_wsgi will compile if "-no-cpp-precomp -isystem /usr/include" is deleted 
from the Makefile prior to running bmake. (Thanks again to pkg maintainer Jan 
Danielsson who helped me figure this out.)

Original issue reported on code.google.com by j...@sdf.lonestar.org on 6 Sep 2011 at 12:20

GoogleCodeExporter commented 8 years ago
Do you have CPPFLAGS set in your user environment? If you do then unset it and 
try again.

That is the only way I can think that '-no-cpp-precomp -isystem /usr/include' 
is getting included as the configure script should filter such stuff out if it 
appears in lib/python2.6/config/Makefile where flags are sourced from. It 
doesn't filter CPPFLAGS from user environment though.

Original comment by Graham.Dumpleton@gmail.com on 6 Sep 2011 at 1:24

GoogleCodeExporter commented 8 years ago
$ cat /usr/pkg/lib/python2.6/config/Makefile | grep ^CPPFLAGS
CPPFLAGS=   -I. -IInclude -I$(srcdir)/Include -no-cpp-precomp -isystem 
/usr/include -I/usr/include -I/usr/pkg/include

AFAICT, CPPFLAGS is not being set anywhere else in my env.

Original comment by j...@sdf.lonestar.org on 6 Sep 2011 at 3:47

GoogleCodeExporter commented 8 years ago
What do you get doing the following in Python:

  from distutils import sysconfig 

  print repr(sysconfig.get_config_var("INCLUDEPY"))
  print repr(sysconfig.get_config_var("CFLAGS"))

Original comment by Graham.Dumpleton@gmail.com on 6 Sep 2011 at 3:52

GoogleCodeExporter commented 8 years ago
$ /usr/pkg/bin/python2.6
Python 2.6.6 (r266:84292, May 25 2011, 12:31:55) 
>>> from distutils import sysconfig
>>> print repr(sysconfig.get_config_var("INCLUDEPY"))
'/usr/pkg/include/python2.6'
>>> print repr(sysconfig.get_config_var("CFLAGS"))
'-fno-strict-aliasing -pipe -O2 -DHAVE_DB_185_H -I/usr/include 
-I/usr/pkg/include -DNDEBUG -pipe -O2 -DHAVE_DB_185_H -I/usr/include 
-I/usr/pkg/include'

Original comment by j...@sdf.lonestar.org on 6 Sep 2011 at 3:56

GoogleCodeExporter commented 8 years ago
Can you rerun 'configure' but do it under shell as:

  sh -x configure

and capture output into a file and attach here.

Original comment by Graham.Dumpleton@gmail.com on 6 Sep 2011 at 4:06

GoogleCodeExporter commented 8 years ago
Closing due to no further information in relation to last question asked being 
supplied and no other reports of issue.

Original comment by Graham.Dumpleton@gmail.com on 19 Mar 2012 at 10:39