Menu

#53 Use $(CURDIR) instead of $(PWD) in Makefile.in

v1.7
closed-fixed
ABC
Bug (12)
4
2011-04-04
2011-04-04
Anonymous
No

One common scenario of software installation is:

$ ./configure
$ make
$ sudo make install

So that configuring and compiling are made on behalf of unprivileged user, and installing is performed with root privileges.
In Makefile's minstall target the $(PWD) variable is used to determine current directory. But given to `man sudo` the $PWD environmental variable isn't propagated nor set by sudo, so $(PWD) is empty when user invokes `sudo make install` and hence installation of kernel module fails.

Given to "GNU make" manual [1], `make` provides the $(CURDIR) variable, which has the same value as $(PWD), but it is guaranteed
to be set.

So I suggest to change all using of $(PWD) variable to use $(CURDIR) variable to fix this issue and achieve more portability for ipt-netflow. Patch against current git HEAD is attached.

[1] http://www.gnu.org/software/make/manual/html_node/Recursion.html (last paragraph).

Discussion

  • Nobody/Anonymous

    Replace all $(PWD)s in Makefile.in to $(CURDIR)

     
  • ABC

    ABC - 2011-04-04

    Thanks.

     
  • ABC

    ABC - 2011-04-04
    • priority: 5 --> 4
    • assigned_to: nobody --> aabc
    • status: open --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.