patchThe FreeType Project - Patches: patch #7971, check for gmake and/or MAKE (not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7971: check for gmake and/or MAKE (not just GNUMAKE variable)

Submitter:  Mojca Miklavec <mojca>
Submitted:  Tue 12 Mar 2013 12:10:16 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  wl Open/Closed:  Closed

Jump to the original submission

Sun 31 Mar 2013 11:33:52 AM UTC, comment #11: 

Thank you.

Mojca Miklavec <mojca>
Sun 31 Mar 2013 07:07:24 AM UTC, comment #10: 

Even not completely portable, I've used Nelson's idea.  Fixed in git, thanks.

Werner LEMBERG <wl>
Group administrator
Sat 30 Mar 2013 11:30:59 PM UTC, comment #9: 

The other suggestion by Nelson H. F. Beebe on the TeX Live builders' mailing list was to use

gmake -v 2>/dev/null | egrep 'GNU|makepp'

(and this also works on Solaris)

Mojca Miklavec <mojca>
Sat 30 Mar 2013 10:46:04 PM UTC, comment #8: 

Just to make sure that it doesn't get too boring. The following fails on Solaris:

gmake -v 2>/dev/null | grep '\(GNU\|makepp\)'

Or rather: it doesn't return anything.

The following works however:

gmake -v 2>/dev/null | grep 'GNU'

and so does

gmake -v 2>/dev/null | ggrep '\(GNU\|makepp\)'


One could do dirty tricks figuring out whether grep is "compliant", or trying to respect user's setting for $GREP (export GREP=ggrep for example), but my suggestion would be to simply split this grep statement into two separate ones. (I'm very sorry for my previous suggestion which broke functionality somewhere else.)

Mojca Miklavec <mojca>
Thu 21 Mar 2013 10:09:02 PM UTC, comment #7: 

Yes, it works perfect now, thank you very much.

Mojca Miklavec <mojca>
Thu 21 Mar 2013 09:59:07 PM UTC, comment #6: 

Ah, now I understand.  Added to git, please test.

Werner LEMBERG <wl>
Group administrator
Thu 21 Mar 2013 08:51:55 PM UTC, comment #5: 

Just a note: I'm not trying to say that I want to use "make" that is not a GNU Make. All I want to say is that numerous systems provide their own make command which might (or might not work), but in many cases there is a command "gmake" installed in addition.

So if make is not a GNU make, it make sense to test if "gmake" exists and works. This is what TeX Live does for example. Note that TeX Live will work out-of-the-box now with this patch (which has already been applied), but it would still be nice if Freetype2 could be compiled out-of-the-box (outside of TeX Live), even without explicitly setting MAKE, when gmake exists.

Mojca Miklavec <mojca>
Thu 21 Mar 2013 08:46:05 PM UTC, comment #4: 

The make on FreeBSD doesn't seem to be a GNU make.


$ make -v
make: no target to make.


However I have no clue what type/version exactly that is. I only know that FreeBSD is widespread enough and that it is definitely not the only platform where this is the case.


MAKE(1)                 FreeBSD General Commands Manual                MAKE(1)

NAME
     make -- maintain program dependencies

SYNOPSIS
     make [-ABPSXeiknpqrstv] [-C directory] [-D variable] [-d flags]
          [-E variable] [-f makefile] [-I directory] [-j max_jobs]
          [-m directory] [-V variable] [-x warning_options] [variable=value]
          [target ...]

DESCRIPTION
     The make utility is a program designed to simplify the maintenance of
     other programs.  Its input is a list of specifications describing depen-
     dency relationships between the generation of files and programs.


The same is true for Solaris


> make -v
make: Warning: Ignoring DistributedMake -v option
make: Fatal error: No arguments to build



SunOS Specific Commands                                  make(1S)

NAME
     make - maintain, update, and regenerate related programs and
     files

SYNOPSIS
     /usr/ccs/bin/make [-d] [-dd] [-D] [-DD] [-e] [-i] [-k] [-n]
          [-p] [-P] [-q] [-r] [-s] [-S] [-t] [-u] [-w] [-V]
          [-f makefile]... [-K statefile]... [target]...
          [macro = value...]


     /usr/xpg4/bin/make [-d] [-dd] [-D] [-DD] [-e] [-i] [-k]
          [-n] [-p] [-P] [-q] [-r] [-s] [-S] [-t] [-u][-w] [-V]
          [-f makefile]... [target]... [macro = value...]


DESCRIPTION
     The make utility executes a list of shell  commands  associ-
     ated  with each target, typically to create or update a file
     of the same name. makefile contains  entries  that  describe
     how  to  bring  a target up to date with respect to those on
     which it depends, which are called dependencies. Since  each
     dependency is a target, it can have dependencies of its own.
     Targets, dependencies, and sub-dependencies comprise a  tree
     structure  that  make traces when deciding whether or not to
     rebuild a target.


Both systems provide gmake as a command and that one is the right one and works fine.

Mojca Miklavec <mojca>
Thu 21 Mar 2013 06:48:24 PM UTC, comment #3: 


> Is there any chance to also check "gmake" in case
> that neither MAKE not GMAKE are defined and in case
> that "make" doesn't pass the "grep GNU" test?


Before looking more closely, I ask you for your real-world example.  What `make' program do you want to use which doesn't pass the `grep GNU' test?  This sounds weird.

Werner LEMBERG <wl>
Group administrator
Thu 21 Mar 2013 10:13:25 AM UTC, comment #2: 

One more question.

The code currently does

# if GMAKE in not defined
  if test "x$MAKE" = x; then
    MAKE=make
  fi

and later on checks for GNU make:
    if test -z "`$MAKE -v 2>/dev/null | grep GNU`"; then

Is there any chance to also check "gmake" in case that neither MAKE not GMAKE are defined and in case that "make" doesn't pass the "grep GNU" test? So something like the following:


# respect GNUMAKE environment variable for backwards compatibility
if test "x$GNUMAKE" = x; then
  if test "x$MAKE" = x; then
    if test -z "`make -v 2>/dev/null | grep '\(GNU\|makeapp\)'`"; then
      # maybe further test if gmake exists at all, so that the script doesn't end up running "-v 2>/dev/null"
      MAKE=gmake
    else
      MAKE=make
    fi
  fi
else
  MAKE=$GNUMAKE
fi

if test -z "`$MAKE -v 2>/dev/null | grep GNU`"; then
  if test -z "`$MAKE -v 2>/dev/null | grep makepp`"; then
    echo "GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2." >&2
    echo "Please try" >&2
    echo "  \`MAKE=<GNU make command name> $0'." >&2
    echo "or >&2"
    echo "  \`MAKE=\"makepp --norc-substitution\" $0'." >&2
    exit 1
  fi
fi



Alternatively, keep the first part as is and change the second one to something similar to:

if test -z "`$MAKE -v 2>/dev/null | grep GNU`"; then
  if test -z "`$MAKE -v 2>/dev/null | grep makepp`"; then
    if test -z "`gmake -v 2>/dev/null | grep 'GNU Make'`"; then
      echo "GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2." >&2
      echo "Please try" >&2
      echo "  \`MAKE=<GNU make command name> $0'." >&2
      echo "or >&2"
      echo "  \`MAKE=\"makepp --norc-substitution\" $0'." >&2
      exit 1
    else
      MAKE=gmake
    fi
  fi
fi

Mojca Miklavec <mojca>
Thu 21 Mar 2013 08:08:48 AM UTC, comment #1: 

Hello Mojca!

Funny that you are submitting a patch without a patch.  The next time please do an ordinary bug report. :-)

The GNUMAKE variable seems to be an old remnant of cygwin support; at least I couldn't find any other hint in the internet.

It should be fixed now in the git repository; please test.

Werner LEMBERG <wl>
Group administrator
Tue 12 Mar 2013 12:10:16 PM UTC, original submission:  


When I try to configure the freetype as part of a larger project, it fails with

    > ./configure
    GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2.
    Please try
      `GNUMAKE=<GNU make command name> ./configure'.
    or >&2
      `GNUMAKE="makepp --norc-substitution" ./configure'.

despite having set
    export MAKE=gmake
and having a working gmake. I can fix this trivially by setting GNUMAKE=gmake, but it would be very nice if configure was able to find gmake on its own, or at least try to check if the MAKE variable has been set.

A larger project uses the following code:

MAKE=make;
if make -v 2>&1| grep "GNU Make" >/dev/null
then~
  echo "Your make is a GNU-make; I will use that"
elif gmake -v >/dev/null 2>&1
then
  MAKE=gmake;
  export MAKE;
  echo "You have a GNU-make installed as gmake; I will use that"
else
  echo "I can't find a GNU-make; I'll try to use make and hope that works."~
  echo "If it doesn't, please install GNU-make."
fi

it could (and probably will) export GNUMAKE in addition to MAKE to make freetype happy, but it would be a lot better if also freetype would do some checking on existence of gmake and/or MAKE. You could use some parts of the above code.

Mojca Miklavec <mojca>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by mojca (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-03-21 wl Open/ClosedOpen Closed
    2013-03-21 wl StatusNone Done
        Assigned toNone wl

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code