-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'github/nasm-2.16.xx'
- Loading branch information
Showing
8 changed files
with
137 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dnl -------------------------------------------------------------------------- | ||
dnl PA_ADD_CPPFLAGS(variable, flag [,actual_flag [,success [,failure]]]]) | ||
dnl | ||
dnl Attempt to add the given option to xFLAGS, if it doesn't break | ||
dnl compilation. If the option to be tested is different than the | ||
dnl option that should actually be added, add the option to be | ||
dnl actually added as a second argument. | ||
dnl -------------------------------------------------------------------------- | ||
AC_DEFUN([PA_ADD_CPPFLAGS], [PA_ADD_FLAGS(CPPFLAGS, [$1], [$2], [$3], [$4])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
dnl -------------------------------------------------------------------------- | ||
dnl PA_ADD_FLAGS(variable, flag [,actual_flag [,success [,failure]]]) | ||
dnl PA_ADD_FLAGS(flagvar, flags) | ||
dnl | ||
dnl Attempt to add the given option to CPPFLAGS, if it doesn't break | ||
dnl compilation. If the option to be tested is different than the | ||
dnl option that should actually be added, add the option to be | ||
dnl actually added as a second argument. | ||
dnl Add [flags] to the variable [flagvar] if and only if it is accepted | ||
dnl by all languages affected by [flagvar], if those languages have | ||
dnl been previously seen in the script. | ||
dnl -------------------------------------------------------------------------- | ||
AC_DEFUN([PA_ADD_FLAGS], | ||
[AC_MSG_CHECKING([if $CC accepts $2]) | ||
pa_add_flags__old_flags="$$1" | ||
$1="$$1 $2" | ||
AC_LINK_IFELSE( | ||
[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], | ||
[printf("Hello, World!\n");])], | ||
[AC_MSG_RESULT([yes]) | ||
$1="$pa_add_flags__old_flags ifelse([$3],[],[$2],[$3])" | ||
AC_DEFINE(PA_SYM([$1_],[$2]), 1, | ||
[Define to 1 if compiled with the `$2' compiler flag]) | ||
[ | ||
AS_VAR_PUSHDEF([old], [_$0_$1_orig]) | ||
AS_VAR_PUSHDEF([ok], [_$0_$1_ok]) | ||
AS_VAR_PUSHDEF([flags], [$1]) | ||
AS_VAR_COPY([old], [flags]) | ||
AS_VAR_SET([flags], ["$flags $2"]) | ||
AS_VAR_SET([ok], [yes]) | ||
PA_LANG_FOREACH(PA_FLAGS_LANGLIST($1), | ||
[AS_VAR_IF([ok], [yes], | ||
[AC_MSG_CHECKING([if $]_AC_CC[ accepts $2]) | ||
PA_BUILD_IFELSE([], | ||
[AC_MSG_RESULT([yes])], | ||
[AC_MSG_RESULT([no]) | ||
AS_VAR_SET([ok], [no])])]) | ||
]) | ||
AS_VAR_IF([ok], [yes], | ||
[m4_ifnblank([$3],[AS_VAR_SET([flags], ["$old $3"])]) | ||
m4_foreach_w([_pa_add_flags_flag], [m4_ifblank([$3],[$2],[$3])], | ||
[AC_DEFINE(PA_SYM([$1_]_pa_add_flags_flag), 1, | ||
[Define to 1 if compiled with the ]_pa_add_flags_flag[ compiler flag])]) | ||
$4], | ||
[AC_MSG_RESULT([no]) | ||
$1="$pa_add_flags__old_flags" | ||
$5])]) | ||
[AS_VAR_SET([flags], ["$old"]) | ||
$5]) | ||
AS_VAR_POPDEF([flags]) | ||
AS_VAR_POPDEF([ok]) | ||
AS_VAR_POPDEF([old]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
dnl -------------------------------------------------------------------------- | ||
dnl PA_BUILD_IFELSE(input [,success [,failure]]) | ||
dnl | ||
dnl Same as AC_LINK_IFELSE for languages where linking is applicable, | ||
dnl otherwise AC_COMPILE_IFELSE. | ||
dnl | ||
dnl If the first argument is empty, use _AC_LANG_IO_PROGRAM. | ||
dnl -------------------------------------------------------------------------- | ||
m4_defun([_PA_BUILD_IFELSE], | ||
[m4_case(_AC_LANG, | ||
[Erlang], [AC_COMPILE_IFELSE($@)], | ||
[AC_LINK_IFELSE($@)])]) | ||
|
||
AC_DEFUN([PA_BUILD_IFELSE], | ||
[_PA_BUILD_IFELSE([m4_ifblank([$1],[AC_LANG_SOURCE(_AC_LANG_IO_PROGRAM)], | ||
[$1])],[$2],[$3])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
dnl -------------------------------------------------------------------------- | ||
dnl PA_FLAGS_LANGLIST(flagvar) | ||
dnl | ||
dnl Return a list of languages affected by the variable flagvar. | ||
dnl If flagvar is unknown, assume it affects the current language. | ||
dnl -------------------------------------------------------------------------- | ||
AC_DEFUN([PA_FLAGS_LANGLIST], | ||
[m4_dquote(m4_case([$1], | ||
[CPPFLAGS], [[C],[C++],[Objective C],[Objective C++]], | ||
[CFLAGS], [[C]], | ||
[CXXFLAGS], [[C++]], | ||
[FFLAGS], [[Fortran 77]], | ||
[FCFLAGS], [[Fortran]], | ||
[ERLCFLAGS], [[Erlang]], | ||
[OBJCFLAGS], [[Objective C]], | ||
[OBJCXXFLAGS], [[Objective C++]], | ||
[GOFLAGS], [[Go]], | ||
[LDFLAGS], [[C],[C++],[Fortran 77],[Fortran],[Objective C],[Objective C++],[Go]], | ||
m4_dquote(_AC_LANG)))]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
dnl -------------------------------------------------------------------------- | ||
dnl PA_LANG_FOREACH(subset, body) | ||
dnl | ||
dnl Expand [body] for each language encountered in the configure script also | ||
dnl present in [subset], or all if [subset] is empty | ||
dnl -------------------------------------------------------------------------- | ||
AC_DEFUN([_PA_LANG_DO],dnl | ||
[AC_LANG([$2])dnl | ||
$1]) | ||
|
||
AC_DEFUN([PA_LANG_FOREACH],dnl | ||
[m4_pushdef([_pa_lang_foreach_current],[_AC_LANG])dnl | ||
m4_map_args([m4_curry([_PA_LANG_DO],[$2])],m4_unquote(PA_LANG_SEEN_LIST($1)))dnl | ||
AC_LANG(_pa_lang_foreach_current)dnl | ||
m4_popdef([_pa_lang_foreach_current])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
dnl -------------------------------------------------------------------------- | ||
dnl PA_LANG_SEEN_LIST(subset) | ||
dnl | ||
dnl List of the language lang has been used in the configuration | ||
dnl script so far, possibly subset by [subset]. | ||
dnl | ||
dnl This relies on overriding _AC_LANG_SET(from, to), | ||
dnl the internal implementation of _AC_LANG. | ||
dnl -------------------------------------------------------------------------- | ||
m4_ifndef([_PA_LANG_SET], | ||
[m4_rename([_AC_LANG_SET], [_PA_LANG_SET])dnl | ||
m4_defun([_AC_LANG_SET], [m4_set_add([_PA_LANG_SEEN_SET],[$2])dnl | ||
_PA_LANG_SET($@)])]) | ||
|
||
AC_DEFUN([PA_LANG_SEEN_LIST], | ||
[m4_set_delete([_pa_lang_seen_subset])dnl | ||
m4_pushdef([_pa_lang_seen_subset_list],m4_ifnblank([$1],[$1],m4_dquote(m4_set_list([_PA_LANG_SEEN_SET]))))dnl | ||
m4_set_add_all([_pa_lang_seen_subset],_pa_lang_seen_subset_list)dnl | ||
m4_cdr(m4_set_intersection([_pa_lang_seen_subset],[_PA_LANG_SEEN_SET]))dnl | ||
m4_popdef([_pa_lang_seen_subset_list])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters