LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-29-2019, 01:07 PM   #1
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,026
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Question Learning how to create and change configure scripts


I'm playing with configure scripts so I would like to learn how to create, modify and manage configure scripts.

I'm planning on creating a few apps in C and/or C++ so I would like to create the configure/make/make install scripts.

Amy good resources to get started, books and online resources would ne good.

Thanks
 
Old 04-29-2019, 01:09 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,992

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
probably this: https://en.wikipedia.org/wiki/Configure_script
 
1 members found this post helpful.
Old 04-29-2019, 01:21 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
The link posted by pan64 is an excellent place to start.

In that page you will find a link to the GNU Autoconf page, be sure to follow it. Finally, in that page you will find a list of Related Software. You will need to refer to the GNU M4 macro language and macros plus Automake for the full picture.
 
1 members found this post helpful.
Old 04-29-2019, 05:25 PM   #4
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,026

Original Poster
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Thanks guys, those wiki pages are good, but I'fd like to know about the configure script, in particular lets take these lines
Quote:
die_license_disabled gpl libcdio
die_license_disabled gpl libutvideo
die_license_disabled gpl libx264
die_license_disabled gpl libxavs
die_license_disabled gpl libxvid
die_license_disabled gpl x11grab
If I wanted to build the app with x11grab enabled I think I can supply a switch like this:
Quote:
./configure --enable-x11grab
Could I just remove the
Quote:
die_license_disabled gpl x11grab
line instead?
 
Old 04-30-2019, 12:19 AM   #5
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
With autotools you should normally not directly edit the configure script or any of the Makefile.in files and should only touch the configure.ac and Makefile.am files. These are used to generate configure and the Makefile.in files with tools like autoreconf.
 
2 members found this post helpful.
Old 04-30-2019, 04:01 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,992

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
That's why I posted that wiki page and that's why were the auto* tools mentioned (because the file itself is generated).
Obviously you can modify that file and test if that works, but that is not the "official" way (unfortunately it is not that simple, but in some cases it may work).
 
Old 04-30-2019, 09:39 AM   #7
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Rep: Reputation: 12
I have been busy editing the "configure" for few reasons.
I do not have theoretical knowledge about the "auto" processes creating the "configure", and after looking at the wiki "flowchart" I am not so sure I want to dig into it at this point.

After all my objective was not to analyse "configure" but use it with desired options.

Being opinionated, I believe one has to assume that some processes just do what they are designed to do and I find it unnecessary to "start from Adam".

"running" configure script is rudimentary and after figuring out the "innards" it is pretty strait forward to make MINOR changes and verify them.

I am not so sure if same can be done by modifying the "autox" processes.
At least it would be two step process and the "configure" would still have to be optioned to provide necessary debugging data. ( yes I use the log file )

On the lighter site - I find it "humorous" to see footprints of different developer's coding methods, some code is pretty obvious some pretty obfuscated.

Bottom line - when "configure" works - no problema, but when it fails it is a challenge.
Cheers
 
Old 04-30-2019, 09:45 AM   #8
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
There are some projects which do just as you suggest and modify configure and makefile.in files manually and sometimes they are handwritten (While still using autotools), these solutions are often half broken and very hard to work with. If you intend for other people to use your work, please don't do this! Of course, lot of things can be learned from reading and understanding these auto-generated files.
 
Old 04-30-2019, 10:44 AM   #9
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Rep: Reputation: 12
Quote:
Originally Posted by orbea View Post
There are some projects which do just as you suggest and modify configure and makefile.in files manually and sometimes they are handwritten (While still using autotools), these solutions are often half broken and very hard to work with. If you intend for other people to use your work, please don't do this! Of course, lot of things can be learned from reading and understanding these auto-generated files.
Just out of curiosity.
I see similar comments pretty often.
I generally feel Internet forums are not where professional developers take their questions.
When I was paid to do product QA , evaluating software, I consulted the fellow ,also paid, employees.

Based on this assumption - why would "amateur developer" even consider his /her work to be of benefits to public by considering all "if this then what" situations?

But on similar note - anybody who inspire to make public happy should at least comment their ware.

Got to run.. honey does waiting ...
Cheers
 
Old 04-30-2019, 12:52 PM   #10
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,026

Original Poster
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by orbea View Post
If you intend for other people to use your work, please don't do this! Of course, lot of things can be learned from reading and understanding these auto-generated files.
Thanks for your reply.

I don't intend anyone else apart from myself to use my work, so if I break it it only affects me.
 
Old 04-30-2019, 12:56 PM   #11
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,026

Original Poster
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by pan64 View Post
That's why I posted that wiki page and that's why were the auto* tools mentioned (because the file itself is generated).
Obviously you can modify that file and test if that works, but that is not the "official" way (unfortunately it is not that simple, but in some cases it may work).
I find the only way to really learn how something works is to do it manually.

I know about the auto* tools, I know what they're for, but I'm experimenting and playing with the code to understand it. I know I may break something, but you can't bake a cake without breaking a few eggs. That's why I want to edit the configure script - to learn how it works!

Thanks to all of you who replied - great forum.
 
Old 04-30-2019, 01:01 PM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,992

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
Quote:
Originally Posted by GPGAgent View Post
I find the only way to really learn how something works is to do it manually.
That is an interesting question. From one side you need to learn how does it really [planned to] work, and that means you need to understand the toolset.
From the other hand you are right, if you want to go into details (deep inside).

Quote:
Originally Posted by GPGAgent View Post
I know about the auto* tools, I know what they're for, but I'm experimenting and playing with the code to understand it. I know I may break something, but you can't bake a cake without breaking a few eggs. That's why I want to edit the configure script - to learn how it works!
The question is: How can you accept if the constructed file actually works, but cannot be generated?
 
Old 05-01-2019, 01:00 PM   #13
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,026

Original Poster
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by pan64 View Post
That is an interesting question. From one side you need to learn how does it really [planned to] work, and that means you need to understand the toolset.
From the other hand you are right, if you want to go into details (deep inside).


The question is: How can you accept if the constructed file actually works, but cannot be generated?
Well obviously if I can construct something that works it's good, the fact it cannot be generated is of no consequence

Cheers, have a nice day now

Last edited by GPGAgent; 05-03-2019 at 05:07 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Machine Learning, Deep Learning 101 LXer Syndicated Linux News 0 07-20-2016 11:00 AM
Coding bootcamp learning platform and privacy issues with online learning. Need Advice ! slothbin Programming 2 04-01-2016 08:33 AM
[SOLVED] RHCSA learning... RHEL6 or CENT OS for learning shejin983 Linux - Server 4 10-27-2012 09:16 AM
How to create configure and install scripts NitinkumarYemul Programming 2 06-16-2010 12:27 AM
E-learning learning, VLS want to help other learn? scheidel21 General 0 04-06-2010 11:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration