diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-07-11 20:52:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-07-11 20:52:58 +0200 |
commit | 69f787af848f4c1271d331a2ae541267fa1404fa (patch) | |
tree | 0cac93f11c55647e994cd7f3a75aec446f13a3b7 /src | |
parent | a9dc375744c80d882d380c40bf05a8db6a17993e (diff) | |
download | vim-git-69f787af848f4c1271d331a2ae541267fa1404fa.tar.gz |
Filter out -pthread for cproto.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 41 | ||||
-rwxr-xr-x | src/auto/configure | 10 | ||||
-rw-r--r-- | src/config.mk.in | 1 | ||||
-rw-r--r-- | src/configure.in | 9 |
4 files changed, 24 insertions, 37 deletions
diff --git a/src/Makefile b/src/Makefile index 33780d00b..0b86b46c8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1279,10 +1279,6 @@ CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \ # -D"foo()=" is not supported by all compilers so do not use it NO_ATTR= # -# maybe the "/usr/bin/cc -E" has to be adjusted for some systems -# This is for cproto 3.5 patchlevel 3: -# PROTO_FLAGS = -f4 -m__ARGS -d -E"$(CPP)" $(NO_ATTR) -# # Use this for cproto 3 patchlevel 6 or below (use "cproto -V" to check): # PROTO_FLAGS = -f4 -m__ARGS -d -E"$(CPP)" $(NO_ATTR) # @@ -1300,10 +1296,9 @@ SHELL = /bin/sh .SUFFIXES: .c .o .pro PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS) -POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(TCL_CFLAGS) $(RUBY_CFLAGS) $(EXTRA_DEFS) -NOPROTO_DEFS = $(PYTHON_NOPROTO) +POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(PERL_CFLAGS) $(ECL_CFLAGS) $(PYTHON_CFLAGS) $(TCL_CFLAGS) $(RUBY_CFLAGS) $(EXTRA_DEFS) -ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS) $(NOPROTO_DEFS) +ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS) # Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together # with "-E". @@ -1315,11 +1310,6 @@ LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)=" DEPEND_CFLAGS = -DPROTO -DDEPEND -DFEAT_GUI $(LINT_CFLAGS) -# If you have problems with flags that cproto doesn't support, and you are -# using GNU make, you can try using the other line to filter out arguments. -#PFLAGS = $(PROTO_FLAGS) -DPROTO $(filter -D% -I%, $(LINT_CFLAGS)) -PFLAGS = $(PROTO_FLAGS) -DPROTO $(LINT_CFLAGS) - ALL_LIB_DIRS = $(GUI_LIBS_DIR) $(X_LIBS_DIR) ALL_LIBS = $(GUI_LIBS1) $(GUI_X_LIBS) $(GUI_LIBS2) $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) $(LIBS) $(EXTRA_LIBS) $(MZSCHEME_LIBS) $(PERL_LIBS) $(PYTHON_LIBS) $(TCL_LIBS) $(RUBY_LIBS) $(PROFILE_LIBS) @@ -1680,46 +1670,53 @@ update-po: proto: $(PRO_AUTO) $(PRO_MANUAL) +# Filter out arguments that cproto doesn't support. +# Don't pass "-pthread" to cproto, it sees it as a list of individual flags. +# The -E"gcc -E" argument must be separate to avoid problems with shell +# quoting. +CPROTO = cproto $(PROTO_FLAGS) -DPROTO \ + `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g'` + ### Would be nice if this would work for "normal" make. ### Currently it only works for (Free)BSD make. #$(PRO_AUTO): $$(*F).c -# cproto $(PFLAGS) -DFEAT_GUI $(*F).c > $@ +# $(CPROTO) -DFEAT_GUI $(*F).c > $@ # Always define FEAT_GUI. This may generate a few warnings if it's also # defined in auto/config.h, you can ignore that. .c.pro: - cproto $(PFLAGS) -DFEAT_GUI $< > proto/$@ + $(CPROTO) -DFEAT_GUI $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_amiga.pro: os_amiga.c - cproto $(PFLAGS) -DAMIGA -UHAVE_CONFIG_H -DBPTR=char* $< > proto/$@ + $(CPROTO) -DAMIGA -UHAVE_CONFIG_H -DBPTR=char* $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_msdos.pro: os_msdos.c - cproto $(PFLAGS) -DMSDOS -UHAVE_CONFIG_H $< > proto/$@ + $(CPROTO) -DMSDOS -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_win16.pro: os_win16.c - cproto $(PFLAGS) -DWIN16 -UHAVE_CONFIG_H $< > proto/$@ + $(CPROTO) -DWIN16 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_win32.pro: os_win32.c - cproto $(PFLAGS) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ + $(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_mswin.pro: os_mswin.c - cproto $(PFLAGS) -DWIN16 -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ + $(CPROTO) -DWIN16 -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_beos.pro: os_beos.c - cproto $(PFLAGS) -D__BEOS__ -UHAVE_CONFIG_H $< > proto/$@ + $(CPROTO) -D__BEOS__ -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ os_vms.pro: os_vms.c # must use os_vms_conf.h for auto/config.h mv auto/config.h auto/config.h.save cp os_vms_conf.h auto/config.h - cproto $(PFLAGS) -DVMS -UFEAT_GUI_ATHENA -UFEAT_GUI_NEXTAW -UFEAT_GUI_MOTIF -UFEAT_GUI_GTK $< > proto/$@ + $(CPROTO) -DVMS -UFEAT_GUI_ATHENA -UFEAT_GUI_NEXTAW -UFEAT_GUI_MOTIF -UFEAT_GUI_GTK $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ rm auto/config.h mv auto/config.h.save auto/config.h @@ -1727,7 +1724,7 @@ os_vms.pro: os_vms.c # if_perl.pro is special: Use the generated if_perl.c for input and remove # prototypes for local functions. if_perl.pro: auto/if_perl.c - cproto $(PFLAGS) -DFEAT_GUI auto/if_perl.c | sed "/_VI/d" > proto/$@ + $(CPROTO) -DFEAT_GUI auto/if_perl.c | sed "/_VI/d" > proto/$@ notags: diff --git a/src/auto/configure b/src/auto/configure index 5e0e57ad8..20f723b9b 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -641,7 +641,6 @@ TCL_SRC vi_cv_path_tcl PYTHON_OBJ PYTHON_SRC -PYTHON_NOPROTO PYTHON_CFLAGS PYTHON_GETPATH_CFLAGS PYTHON_LIBS @@ -5112,7 +5111,6 @@ fi else PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}" fi - PYTHON_NOPROTO= PYTHON_SRC="if_python.c" if test "x$MACOSX" = "xyes"; then PYTHON_OBJ="objects/if_python.o" @@ -5124,7 +5122,7 @@ fi fi PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 $as_echo_n "checking if -pthread should be used... " >&6; } threadsafe_flag= thread_lib= @@ -5153,7 +5151,7 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; PYTHON_NOPROTO="$threadsafe_flag" +$as_echo "yes" >&6; }; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; LIBS=$libs_save_old @@ -5171,7 +5169,7 @@ $as_echo "no" >&6; } $as_echo_n "checking if compile and link flags for Python are sane... " >&6; } cflags_save=$CFLAGS libs_save=$LIBS - CFLAGS="$CFLAGS $PYTHON_CFLAGS $PYTHON_NOPROTO" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" LIBS="$LIBS $PYTHON_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5204,7 +5202,6 @@ rm -f core conftest.err conftest.$ac_objext \ PYTHON_OBJ= PYTHON_LIBS= PYTHON_CFLAGS= - PYTHON_NOPROTO= fi fi @@ -5221,7 +5218,6 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-tclinterp argument" >&5 $as_echo_n "checking --enable-tclinterp argument... " >&6; } # Check whether --enable-tclinterp was given. diff --git a/src/config.mk.in b/src/config.mk.in index a298fae2f..2586558af 100644 --- a/src/config.mk.in +++ b/src/config.mk.in @@ -56,7 +56,6 @@ PERL_CFLAGS = @PERL_CFLAGS@ PYTHON_SRC = @PYTHON_SRC@ PYTHON_OBJ = @PYTHON_OBJ@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ -PYTHON_NOPROTO = @PYTHON_NOPROTO@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_CONFDIR = @PYTHON_CONFDIR@ PYTHON_GETPATH_CFLAGS = @PYTHON_GETPATH_CFLAGS@ diff --git a/src/configure.in b/src/configure.in index a18c68317..567c7a218 100644 --- a/src/configure.in +++ b/src/configure.in @@ -764,7 +764,6 @@ eof else PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}" fi - PYTHON_NOPROTO= PYTHON_SRC="if_python.c" dnl For Mac OSX 10.2 config.o is included in the Python library. if test "x$MACOSX" = "xyes"; then @@ -784,8 +783,6 @@ eof dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC dnl will then define target-specific defines, e.g., -D_REENTRANT. dnl Don't do this for Mac OSX, -pthread will generate a warning. - dnl Need to put -pthread in PYTHON_NOPROTO, because it cannot be used - dnl for cproto. AC_MSG_CHECKING([if -pthread should be used]) threadsafe_flag= thread_lib= @@ -803,7 +800,7 @@ eof CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" AC_TRY_LINK(,[ ], - AC_MSG_RESULT(yes); PYTHON_NOPROTO="$threadsafe_flag", + AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", AC_MSG_RESULT(no); LIBS=$libs_save_old ) CFLAGS=$cflags_save @@ -816,7 +813,7 @@ eof AC_MSG_CHECKING([if compile and link flags for Python are sane]) cflags_save=$CFLAGS libs_save=$LIBS - CFLAGS="$CFLAGS $PYTHON_CFLAGS $PYTHON_NOPROTO" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" LIBS="$LIBS $PYTHON_LIBS" AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_ok=yes, @@ -831,7 +828,6 @@ eof PYTHON_OBJ= PYTHON_LIBS= PYTHON_CFLAGS= - PYTHON_NOPROTO= fi fi @@ -844,7 +840,6 @@ AC_SUBST(PYTHON_CONFDIR) AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_GETPATH_CFLAGS) AC_SUBST(PYTHON_CFLAGS) -AC_SUBST(PYTHON_NOPROTO) AC_SUBST(PYTHON_SRC) AC_SUBST(PYTHON_OBJ) |