philpem / printer-driver-ptouch

P-Touch PT-series and QL-series printer driver for Linux (under CUPS)
GNU General Public License v2.0
97 stars 24 forks source link

autoconf fails #15

Closed garyemiller closed 3 years ago

garyemiller commented 3 years ago

I just cloned this repo. Then:

kong printer-driver-ptouch # autoconf
configure.ac:8: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:8: You should run autoupdate.
./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:8: the top level
configure.ac:6: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
kong printer-driver-ptouch # ./configure 
./configure: line 2381: syntax error near unexpected token `-Wall'
./configure: line 2381: `AM_INIT_AUTOMAKE(-Wall -Wno-portability)'
kong printer-driver-ptouch # autoupdate
kong printer-driver-ptouch # autoconf
configure.ac:6: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
kong printer-driver-ptouch # ./configure
./configure: line 2381: syntax error near unexpected token `-Wall'
./configure: line 2381: `AM_INIT_AUTOMAKE(-Wall -Wno-portability)'

I am using autoconf Version 2.71-r1

Ideas?

philpem commented 3 years ago

You're running the "autoconf" command, which isn't how you rebuild the configure script.

First you need to make sure you have both autoconf and automake installed. Next, run autoreconf -fi to rebuild the configuration script.

Note this is autoreconf -- not autoconf. It's an easy mistake to make!

That's also quite a new version of Autoconf - which OS are you building on?

garyemiller commented 3 years ago

You're running the "autoconf" command, which isn't how you rebuild the configure script.

I just followed the included INSTALL file. You might want to fix that.

This worked, thanks for the hint:

autoreconf -fi 
./configure && make && make install

I am building on Gentoo Unstable. Trying to wake up an old QL-500.

philpem commented 3 years ago

They're the standard FSF ones that Autoconf puts in place when you create a new project ... I have to confess I've never read them. Now I have, I see your point.

It might be some time before I have chance to rewrite it, but please feel free to submit a PR if you choose to.

There's a script in the source drop called "autogen.sh" which does the Autoconf/Automake steps. But your commands are fine, and very similar to how the Ubuntu/Debian packages are built.

garyemiller commented 3 years ago

How about this:

index 90bf295..2d021c8 100644
--- a/README
+++ b/README
@@ -12,6 +12,10 @@ A significant code clean-up was done by Andreas Gruenbacher in May 2020.

 See the file `INSTALL' for directions on how to install this software.

+Or, to build and install, do this as root:
+
+# autogen.sh && ./configure && make && make install
+
 After installing, you will probably have to reload or restart CUPS.

 This package contains the following directories:

Make install installed this into /usr/local/share/foomatic/db/source/printer, but my foomatic is not looking there. Is there an easy solution?

philpem commented 3 years ago

What OS are you running?

garyemiller commented 3 years ago

What OS are you running?

As I said above:

I am building on Gentoo Unstable.

philpem commented 3 years ago

Sorry, I missed that. I don't really use Gentoo so I'm not aware of its quirks.

For Debian variants, the packages build with a prefix of /usr, but the default for configure is /usr/local. You could try doing a make uninstall ; make clean, then redo the configuration process with ./configure --prefix=/usr && make && make install.

Is there not a Gentoo package of ptouch-driver?

garyemiller commented 3 years ago

Sorry, I missed that. I don't really use Gentoo so I'm not aware of its quirks.

Gentoo has very few quirks. They believe that upstream should take precedence. So assume a basic foomatic install from source, into /usr/. I guess I could just install your code into /usr/ as well, but I assumed there would be a simple config file to tell foomatic where to look.

For Debian variants, the packages build with a prefix of /usr

Right out of the FHS, except for when Debian ignore the FHS. Gentoo is much better at FHS compliance than Debian.

./configure --prefix=/usr

Then /usr/local/share/foomatic/db/source/printer would become /usr/share/foomatic/db/source/printer/ which is the correct place. As long as it does not over-write anything from the base package that is already there.

Is there not a Gentoo package of ptouch-driver?

Nope. Not in the base repository, or in the brother-overlay repository.

Gentoo is short maintainers for "new" packages, so no point in me filing a bug on that.

garyemiller commented 3 years ago

After some study, I found no obvious collisions by using prefix=/usr. Installing that way worked fine for me.

So go ahead and close this if you wish.